From 4fa07314fab18b739debbe16b3526f472e362f62 Mon Sep 17 00:00:00 2001 From: mikemayhem3030 Date: Mon, 25 Jul 2022 08:26:00 +0100 Subject: [PATCH 1/2] initial play with moving to a top level menu --- css/wpsc-feedback.css | 9 ++++++++ css/wpsc-feedback.min.css | 1 + scss/wpsc-feedback.css | 9 ++++++++ scss/wpsc-feedback.scss | 11 ++++++++++ wp-cache.php | 46 ++++++++++++++++++++++++++++++++++++++- 5 files changed, 75 insertions(+), 1 deletion(-) create mode 100644 css/wpsc-feedback.css create mode 100644 css/wpsc-feedback.min.css create mode 100644 scss/wpsc-feedback.css create mode 100644 scss/wpsc-feedback.scss diff --git a/css/wpsc-feedback.css b/css/wpsc-feedback.css new file mode 100644 index 00000000..4cfaa020 --- /dev/null +++ b/css/wpsc-feedback.css @@ -0,0 +1,9 @@ +.wpsc-survey-wrapper { + position: relative; + background: white; + padding: 10%; + margin: 2em; + text-align: center; } + .wpsc-survey-wrapper .credits { + position: absolute; + bottom: 5x; } diff --git a/css/wpsc-feedback.min.css b/css/wpsc-feedback.min.css new file mode 100644 index 00000000..2551317d --- /dev/null +++ b/css/wpsc-feedback.min.css @@ -0,0 +1 @@ +.wpsc-survey-wrapper{position:relative;background:#fff;padding:10%;margin:2em;text-align:center}.wpsc-survey-wrapper .credits{position:absolute;bottom:5x} \ No newline at end of file diff --git a/scss/wpsc-feedback.css b/scss/wpsc-feedback.css new file mode 100644 index 00000000..4cfaa020 --- /dev/null +++ b/scss/wpsc-feedback.css @@ -0,0 +1,9 @@ +.wpsc-survey-wrapper { + position: relative; + background: white; + padding: 10%; + margin: 2em; + text-align: center; } + .wpsc-survey-wrapper .credits { + position: absolute; + bottom: 5x; } diff --git a/scss/wpsc-feedback.scss b/scss/wpsc-feedback.scss new file mode 100644 index 00000000..1fe9bf5b --- /dev/null +++ b/scss/wpsc-feedback.scss @@ -0,0 +1,11 @@ +.wpsc-survey-wrapper{ + position:relative; + background:white; + padding:10%; + margin:2em; + text-align: center; + .credits{ + position:absolute; + bottom:5x; + } +} \ No newline at end of file diff --git a/wp-cache.php b/wp-cache.php index 36742946..4bc560bf 100644 --- a/wp-cache.php +++ b/wp-cache.php @@ -235,14 +235,58 @@ function wpsupercache_site_admin() { return is_super_admin(); } +/** + * Modifying to add a menu page and submenus thereafter for ease of navigation + */ function wp_cache_add_pages() { if ( wpsupercache_site_admin() ) { // In single or MS mode add this menu item too, but only for superadmins in MS mode. - add_options_page( 'WP Super Cache', 'WP Super Cache', 'manage_options', 'wpsupercache', 'wp_cache_manager' ); + $wp_super_cache_menu = add_menu_page( 'WP Super Cache', 'WP Super Cache', 'manage_options', 'wpsupercache-dash', 'wp_cache_dashboard' ); + add_submenu_page( 'wpsupercache-dash' , 'Settings', 'Settings', 'manage_options', 'wpsupercache', 'wp_cache_manager' ); + add_submenu_page( 'wpsupercache-dash' , 'About', 'About', 'manage_options', 'wpsupercache-about', 'wp_cache_about' ); + $wp_super_cache_menu_feedback = add_submenu_page( 'wpsupercache-dash' , 'Feedback', 'Feedback', 'manage_options', 'wpsupercache-feedback', 'wp_cache_feedback' ); + add_submenu_page( 'wpsupercache-dash' , 'More Plugins', 'More Plugins', 'manage_options', 'wpsupercache-more', 'wp_cache_more' ); + + add_action('admin_print_scripts-' . $wp_super_cache_menu_feedback, 'wp_cache_admin_styles_feedback'); + + } } add_action( 'admin_menu', 'wp_cache_add_pages' ); +function wp_cache_admin_styles_feedback(){ + wp_register_style( 'wpsc_wp_admin_css', plugin_dir_url( __FILE__ ) . 'css/wpsc-feedback.min.css', false, '1.0.0' ); + wp_enqueue_style( 'wpsc_wp_admin_css' ); +} + + +function wp_cache_dashboard(){ + echo "Dashboard"; +} + +function wp_cache_about(){ + echo "About"; +} + +function wp_cache_feedback(){ + ?> +
+ +
+ Crowd Signal', 'wp-super-cache' ), 'https://crowdsignal.com/' ); ?> +
+
+ Date: Mon, 25 Jul 2022 14:27:10 +0100 Subject: [PATCH 2/2] tidying top level menu --- css/wpsc-feedback.css | 3 ++- css/wpsc-feedback.min.css | 2 +- scss/wpsc-feedback.scss | 1 + wp-cache.php | 20 ++------------------ 4 files changed, 6 insertions(+), 20 deletions(-) diff --git a/css/wpsc-feedback.css b/css/wpsc-feedback.css index 4cfaa020..f9ed02de 100644 --- a/css/wpsc-feedback.css +++ b/css/wpsc-feedback.css @@ -6,4 +6,5 @@ text-align: center; } .wpsc-survey-wrapper .credits { position: absolute; - bottom: 5x; } + bottom: 5x; + text-align: center; } diff --git a/css/wpsc-feedback.min.css b/css/wpsc-feedback.min.css index 2551317d..f3ee848d 100644 --- a/css/wpsc-feedback.min.css +++ b/css/wpsc-feedback.min.css @@ -1 +1 @@ -.wpsc-survey-wrapper{position:relative;background:#fff;padding:10%;margin:2em;text-align:center}.wpsc-survey-wrapper .credits{position:absolute;bottom:5x} \ No newline at end of file +.wpsc-survey-wrapper{position:relative;background:#fff;padding:10%;margin:2em;text-align:center}.wpsc-survey-wrapper .credits{position:absolute;bottom:5x;text-align:center} \ No newline at end of file diff --git a/scss/wpsc-feedback.scss b/scss/wpsc-feedback.scss index 1fe9bf5b..fb6a1b95 100644 --- a/scss/wpsc-feedback.scss +++ b/scss/wpsc-feedback.scss @@ -7,5 +7,6 @@ .credits{ position:absolute; bottom:5x; + text-align: center; } } \ No newline at end of file diff --git a/wp-cache.php b/wp-cache.php index 4bc560bf..b67f3040 100644 --- a/wp-cache.php +++ b/wp-cache.php @@ -241,11 +241,8 @@ function wpsupercache_site_admin() { function wp_cache_add_pages() { if ( wpsupercache_site_admin() ) { // In single or MS mode add this menu item too, but only for superadmins in MS mode. - $wp_super_cache_menu = add_menu_page( 'WP Super Cache', 'WP Super Cache', 'manage_options', 'wpsupercache-dash', 'wp_cache_dashboard' ); - add_submenu_page( 'wpsupercache-dash' , 'Settings', 'Settings', 'manage_options', 'wpsupercache', 'wp_cache_manager' ); - add_submenu_page( 'wpsupercache-dash' , 'About', 'About', 'manage_options', 'wpsupercache-about', 'wp_cache_about' ); - $wp_super_cache_menu_feedback = add_submenu_page( 'wpsupercache-dash' , 'Feedback', 'Feedback', 'manage_options', 'wpsupercache-feedback', 'wp_cache_feedback' ); - add_submenu_page( 'wpsupercache-dash' , 'More Plugins', 'More Plugins', 'manage_options', 'wpsupercache-more', 'wp_cache_more' ); + $wp_super_cache_menu = add_menu_page( 'WP Super Cache', 'WP Super Cache', 'manage_options', 'wpsupercache', 'wp_cache_manager' ); + $wp_super_cache_menu_feedback = add_submenu_page( 'wpsupercache' , 'Feedback', 'Feedback', 'manage_options', 'wpsupercache-feedback', 'wp_cache_feedback' ); add_action('admin_print_scripts-' . $wp_super_cache_menu_feedback, 'wp_cache_admin_styles_feedback'); @@ -259,15 +256,6 @@ function wp_cache_admin_styles_feedback(){ wp_enqueue_style( 'wpsc_wp_admin_css' ); } - -function wp_cache_dashboard(){ - echo "Dashboard"; -} - -function wp_cache_about(){ - echo "About"; -} - function wp_cache_feedback(){ ?>
@@ -283,10 +271,6 @@ function wp_cache_feedback(){