diff --git a/.DS_Store b/.DS_Store index 4d5d13f..29152c9 100644 Binary files a/.DS_Store and b/.DS_Store differ diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..36444ed --- /dev/null +++ b/.gitignore @@ -0,0 +1,10 @@ +# folders and files to be ignored by git + +############ +## OSes +############ + +[Tt]humbs.db +[Dd]esktop.ini +*.DS_store +.DS_store? diff --git a/admin/class-remove-links-scripts-settings.php b/admin/class-remove-links-scripts-settings.php index 0fbce8f..7e4a35f 100644 --- a/admin/class-remove-links-scripts-settings.php +++ b/admin/class-remove-links-scripts-settings.php @@ -4,182 +4,195 @@ */ class Remove_Links_Scripts_Settings { - /** - * Class constructor. - */ - public function __construct() { - $this->remove_scripts_settings(); - } - - /** - * Remove Links and Scripts Settings - */ - private function remove_scripts_settings() { - if ( isset( $_POST['submit'] ) ) { - if ( ! isset( $_POST['shortlink'] ) ) { - $_POST['shortlink'] = ''; - } - if ( ! isset( $_POST['rsd_link'] ) ) { - $_POST['rsd_link'] = ''; - } - if ( ! isset( $_POST['wlwmanifest_link'] ) ) { - $_POST['wlwmanifest_link'] = ''; - } - if ( ! isset( $_POST['feed_links'] ) ) { - $_POST['feed_links'] = ''; - } - if ( ! isset( $_POST['emoji_scripts'] ) ) { - $_POST['emoji_scripts'] = ''; - } - if ( ! isset( $_POST['wp_embed'] ) ) { - $_POST['wp_embed'] = ''; - } - if ( ! isset( $_POST['wp_json'] ) ) { - $_POST['wp_json'] = ''; - } - if ( ! isset( $_POST['emoji_styles'] ) ) { - $_POST['emoji_styles'] = ''; - } - if ( ! isset( $_POST['generator'] ) ) { - $_POST['generator'] = ''; - } - if ( ! isset( $_POST['rel_link'] ) ) { - $_POST['rel_link'] = ''; - } - - $remove_settings = array( - 'shortlink' => $_POST['shortlink'], - 'rsd_link' => $_POST['rsd_link'], - 'wlwmanifest_link' => $_POST['wlwmanifest_link'], - 'feed_links' => $_POST['feed_links'], - 'emoji_scripts' => $_POST['emoji_scripts'], - 'wp_embed' => $_POST['wp_embed'], - 'wp_json' => $_POST['wp_json'], - 'emoji_styles' => $_POST['emoji_styles'], - 'generator' => $_POST['generator'], - 'rel_link' => $_POST['rel_link'], - ); - update_option( 'remove_links_scripts', serialize( $remove_settings ) ); - } - $remove_settings = unserialize( get_option('remove_links_scripts') ); - $remove_settings_shortlink_checked = ''; - $remove_settings_rsd_link_checked = ''; - $remove_settings_wlwmanifest_link_checked = ''; - $remove_settings_feed_links_checked = ''; - $remove_settings_emoji_scripts_checked = ''; - $remove_settings_wp_embed_checked = ''; - $remove_settings_wp_json_checked = ''; - $remove_settings_emoji_styles_checked = ''; - $remove_settings_generator_checked = ''; - $remove_settings_rel_link_checked = ''; - - if ( isset( $remove_settings ) ) { - if ( esc_attr( $remove_settings['shortlink'] ) == 'on' ) { - $remove_settings_shortlink_checked = 'checked'; - } - - if ( esc_attr( $remove_settings['rsd_link'] ) == 'on' ) { - $remove_settings_rsd_link_checked = 'checked'; - } - - if ( esc_attr( $remove_settings['wlwmanifest_link'] ) == 'on' ) { - $remove_settings_wlwmanifest_link_checked = 'checked'; - } - - if ( esc_attr( $remove_settings['feed_links'] ) == 'on' ) { - $remove_settings_feed_links_checked = 'checked'; - } - - if ( esc_attr( $remove_settings['emoji_scripts'] ) == 'on' ) { - $remove_settings_emoji_scripts_checked = 'checked'; - } - - if ( esc_attr( $remove_settings['wp_embed'] ) == 'on' ) { - $remove_settings_wp_embed_checked = 'checked'; - } - - if ( esc_attr( $remove_settings['wp_json'] ) == 'on' ) { - $remove_settings_wp_json_checked = 'checked'; - } - - if ( esc_attr( $remove_settings['emoji_styles'] ) == 'on' ) { - $remove_settings_emoji_styles_checked = 'checked'; - } - - if ( esc_attr( $remove_settings['generator'] ) == 'on' ) { - $remove_settings_generator_checked = 'checked'; - } - - if ( esc_attr( $remove_settings['rel_link'] ) == 'on' ) { - $remove_settings_rel_link_checked = 'checked'; - } - } - wp_enqueue_style( 'style', - plugins_url( '/admin/css/admin-style.min.css', REMOVE_LINKS_SCRIPTS_FILE ) - ); - ?> -