diff --git a/src/classes/class-workflow.php b/src/classes/class-workflow.php index b4190c5..c5cce84 100644 --- a/src/classes/class-workflow.php +++ b/src/classes/class-workflow.php @@ -343,6 +343,7 @@ public function add_gif( $input ) { 'next_step' => is_valid_url( $input ) ? 'gif_name' : 'gif_url', 'standby_title' => 'Saving your GIF...', 'standby_text' => 'This should only take a moment, please stand by', + 'original_input' => '', ), ); } @@ -614,7 +615,8 @@ public function launch_editor( $the_gif ) { ), 'variables' => array( 'next_step' => 'save_gif', - 'external' => 'search', + 'trash_mode' => 'true', + 'external' => 'restart', 'notification_title' => "GIF trashed!", 'notification_text' => '"' . $the_gif->name . '" will be permanently deleted in 30 days.', 'exit' => 'false', diff --git a/src/editor.php b/src/editor.php index 66ab2b6..c8f1ce9 100644 --- a/src/editor.php +++ b/src/editor.php @@ -34,13 +34,13 @@ // If this is the manage_tags step, output the tag management interface } elseif ( 'manage_tags' === $flow->next_step ) { - // Alert if input is provided - $flow->alert_select_option( $input ); - // If the current GIF has no tags, skip ahead to the adding tags interface if ( empty( $the_gif->tags ) ) { $flow->add_tags( $input, $the_gif, $tags ); } else { + // Alert if input is provided + $flow->alert_select_option( $input ); + $flow->launch_tag_management(); } diff --git a/src/save.php b/src/save.php index dc5f7d6..8f27049 100644 --- a/src/save.php +++ b/src/save.php @@ -12,19 +12,18 @@ // If the current item is a GIF, enter the GIF saving flow if ( is_gif() ) { // If the selected item is an existing GIF, query it using the ID - if (false != $flow->item_id) { + if ( false != $flow->item_id ) { $the_gif = new GIF( $flow->item_id ); - - // Otherwise, initialize a new, empty GIF object + // Otherwise, initialize a new, empty GIF object } else { $the_gif = new GIF(); // Stage the date for saving later - $the_gif->new_props['date'] = date('F d, Y'); + $the_gif->new_props['date'] = date( 'F d, Y' ); } // If this GIF was marked to be trashed, trash it - if ('true' === $flow->trash_mode) { + if ( 'true' === $flow->trash_mode ) { // Trash the GIF $the_gif->trash(); @@ -61,7 +60,6 @@ // Output workflow configuration $flow->output_config( 'save_gif', $the_gif ); } - // If the current item is a tag, enter the tag saving flow } elseif ( is_tag() ) { $the_tag = new Tag( $flow->item_id ); @@ -70,8 +68,7 @@ if ( 'true' === $flow->confirmed_delete ) { $the_tag->delete(); - - // Otherwise, proceed with updating the tag + // Otherwise, proceed with updating the tag } else { // Set the tag's new name $the_tag->new_name = $flow->tag_name; @@ -82,7 +79,6 @@ // Output workflow configuration $flow->output_config( 'save_tag' ); - // If the selected item was neither a GIF or a tag, abandon all hope } else { // Output workflow error configuration