diff --git a/includes/admin.php b/includes/admin.php index a256c99..f011218 100644 --- a/includes/admin.php +++ b/includes/admin.php @@ -75,7 +75,7 @@ public function migrate_plugin_options() if (isset($old_option['player_theme_color'])) { update_option( 'protected_video_player_theme_color', - $old_option['player_theme_color'] + sanitize_hex_color($old_option['player_theme_color']) ); delete_option('protected_video_option_name'); } @@ -144,16 +144,16 @@ public function settings_page_init() register_setting( 'protected_video_option_group', // settings group name 'protected_video_player_theme_color', // option name - [$this, 'sanitize_plugin_text_input'] // callback + [$this, 'sanitize_plugin_color_input'] // callback ); } /** - * Sanitize plugin option text input data. + * Sanitize plugin option color input data. */ - public function sanitize_plugin_text_input($input) + public function sanitize_plugin_color_input($input) { - return sanitize_text_field($input); + return sanitize_hex_color($input); } /**