From 6427b4c9bd4294876edc98498afa0e7dc02cca98 Mon Sep 17 00:00:00 2001 From: Gary Jones Date: Thu, 17 Mar 2022 09:21:59 +0000 Subject: [PATCH] Move settings page The plugin isn't a tool as such, so the settings page should be under the Settings menu item to make it more intuitive to find. --- src/class-acm-widget.php | 2 +- src/class-ad-code-manager.php | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/class-acm-widget.php b/src/class-acm-widget.php index 8d3ec1c..b3e5d20 100644 --- a/src/class-acm-widget.php +++ b/src/class-acm-widget.php @@ -42,7 +42,7 @@ function form( $instance ) { ?> - plugin_slug, admin_url( 'tools.php' ) ); ?> + plugin_slug, admin_url( 'options-general.php' ) ); ?> Please create one.", 'ad-code-manager' ), esc_url( $create_url ) ); ?>

diff --git a/src/class-ad-code-manager.php b/src/class-ad-code-manager.php index d01d503..8d9ba8b 100644 --- a/src/class-ad-code-manager.php +++ b/src/class-ad-code-manager.php @@ -581,7 +581,7 @@ function edit_conditionals( $ad_code_id, $conditionals = array() ) { * Hook in our submenu page to the navigation */ public function action_admin_menu() { - $hook = add_management_page( + $hook = add_options_page( __( 'Ad Code Manager', 'ad-code-manager' ), __( 'Ad Code Manager', 'ad-code-manager' ), $this->manage_ads_cap, @@ -641,7 +641,7 @@ function parse_readme_into_contextual_help() { function contextual_help() { global $pagenow; - if ( 'tools.php' !== $pagenow || ! isset( $_GET['page'] ) || $_GET['page'] !== $this->plugin_slug ) { + if ( 'options-general.php' !== $pagenow || ! isset( $_GET['page'] ) || $_GET['page'] !== $this->plugin_slug ) { return; } [ $description, $configuration, $filters ] = $this->parse_readme_into_contextual_help(); @@ -716,7 +716,7 @@ function register_scripts_and_styles() { global $pagenow; // Only load this on the proper page - if ( 'tools.php' !== $pagenow || ! isset( $_GET['page'] ) || $_GET['page'] != $this->plugin_slug ) { + if ( 'options-general.php' !== $pagenow || ! isset( $_GET['page'] ) || $_GET['page'] != $this->plugin_slug ) { return; }