| @@ -35,8 +35,9 @@ | ||
| 35 | 35 | /** |
| 36 | 36 | * Handle tools requests from admin-side. |
| 37 | 37 | */ |
| 38 | 38 | public static function handle_requests() { |
| 39 | + add_action( 'admin_post_sharing_image_save_config', array( __CLASS__, 'save_config_tab' ) ); | |
| 39 | 40 | add_action( 'admin_post_sharing_image_export_templates', array( __CLASS__, 'export_templates' ) ); |
| 40 | 41 | add_action( 'admin_post_sharing_image_import_templates', array( __CLASS__, 'import_templates' ) ); |
| 41 | 42 | add_action( 'admin_post_sharing_image_clone_template', array( __CLASS__, 'clone_template' ) ); |
| 42 | 43 | add_action( 'admin_post_sharing_image_clear_templates', array( __CLASS__, 'clear_templates' ) ); |
| @@ -106,14 +107,8 @@ | ||
| 106 | 107 | Settings::redirect_with_message( $redirect, 7 ); |
| 107 | 108 | } |
| 108 | 109 | |
| 109 | 110 | foreach ( $templates as $index => $template ) { |
| 110 | - $index = sanitize_key( $index ); | |
| 111 | - | |
| 112 | - if ( ! Templates::is_valid_unique_index( $index ) ) { | |
| 113 | - $index = Templates::create_unique_index(); | |
| 114 | - } | |
| 115 | - | |
| 116 | 111 | Templates::update_templates( $index, Templates::sanitize_editor( $template ) ); |
| 117 | 112 | } |
| 118 | 113 | |
| 119 | 114 | Settings::redirect_with_message( $redirect, 9 ); |