Skip to content

Commit

Permalink
remove option for removing SEO from top of menu and add filter hook a…
Browse files Browse the repository at this point in the history
  • Loading branch information
michaeltorbert committed Oct 8, 2016
1 parent 59b8b34 commit dba382f
Showing 1 changed file with 5 additions and 31 deletions.
36 changes: 5 additions & 31 deletions aioseop_class.php
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,6 @@ function __construct() {
'cpostactive' => __( 'Use these checkboxes to select which Post Types you want to use All in One SEO Pack with.', 'all-in-one-seo-pack' ),
'taxactive' => __( 'Use these checkboxes to select which Taxonomies you want to use All in One SEO Pack with.', 'all-in-one-seo-pack' ),
'cposttitles' => __( 'This allows you to set the title tags for each Custom Post Type.', 'all-in-one-seo-pack' ),
'custom_menu_order' => __( 'Check this to move the All in One SEO Pack menu item to the top of your WordPress Dashboard menu.', 'all-in-one-seo-pack' ),
'google_verify' => __( "Enter your verification code here to verify your site with Google Webmaster Tools.<br /><a href='http://semperplugins.com/documentation/google-webmaster-tools-verification/' target='_blank'>Click here for documentation on this setting</a>", 'all-in-one-seo-pack' ),
'bing_verify' => __( "Enter your verification code here to verify your site with Bing Webmaster Tools.<br /><a href='http://semperplugins.com/documentation/bing-webmaster-verification/' target='_blank'>Click here for documentation on this setting</a>", 'all-in-one-seo-pack' ),
'pinterest_verify' => __( "Enter your verification code here to verify your site with Pinterest.<br /><a href='http://semperplugins.com/documentation/pinterest-site-verification/' target='_blank'>Click here for documentation on this setting</a>", 'all-in-one-seo-pack' ),
Expand Down Expand Up @@ -268,7 +267,6 @@ function __construct() {
'cpostactive' => '#seo-on-only-these-post-types',
'taxactive' => '#seo-on-only-these-taxonomies',
'cposttitles' => '#custom-titles',
'custom_menu_order' => '#display-menu-at-the-top',
'google_verify' => '',
'bing_verify' => '',
'pinterest_verify' => '',
Expand Down Expand Up @@ -580,10 +578,6 @@ function __construct() {
'aiosp_cpostadvanced' => 'on',
),
),
'custom_menu_order' => array(
'name' => __( 'Display Menu At The Top:', 'all-in-one-seo-pack' ),
'default' => 'on',
),
'google_verify' => array(
'name' => __( 'Google Webmaster Tools:', 'all-in-one-seo-pack' ),
'default' => '',
Expand Down Expand Up @@ -1084,11 +1078,6 @@ function __construct() {
'help_link' => 'http://semperplugins.com/documentation/custom-post-type-settings/',
'options' => array( 'enablecpost', 'cpostadvanced', 'taxactive', 'cpostactive', 'cposttitles' ),
),
'display' => array(
'name' => __( 'Display Settings', 'all-in-one-seo-pack' ),
'help_link' => 'http://semperplugins.com/documentation/display-settings/',
'options' => array( 'custom_menu_order' ),
),
'webmaster' => array(
'name' => __( 'Webmaster Verification', 'all-in-one-seo-pack' ),
'help_link' => 'http://semperplugins.com/sections/webmaster-verification/',
Expand Down Expand Up @@ -4625,11 +4614,7 @@ function admin_menu() {

$this->locations['aiosp']['default_options']['nonce-aioseop-edit']['default'] = wp_create_nonce( 'edit-aioseop-nonce' );

$custom_menu_order = false;
global $aioseop_options;
if ( ! isset( $aioseop_options['custom_menu_order'] ) ) {
$custom_menu_order = true;
}

$this->update_options();

Expand All @@ -4647,28 +4632,17 @@ function admin_menu() {
if ( isset( $_POST['aiosp_donate'] ) ) {
$donated = $_POST['aiosp_donate'];
}
if ( isset( $_POST['Submit'] ) ) {
if ( isset( $_POST['aiosp_custom_menu_order'] ) ) {
$custom_menu_order = $_POST['aiosp_custom_menu_order'];
} else {
$custom_menu_order = false;
}
} else if ( isset( $_POST['Submit_Default'] ) || isset( $_POST['Submit_All_Default'] ) ) {
$custom_menu_order = true;
}
} else {
if ( isset( $this->options['aiosp_donate'] ) ) {
$donated = $this->options['aiosp_donate'];
}
if ( isset( $this->options['aiosp_custom_menu_order'] ) ) {
$custom_menu_order = $this->options['aiosp_custom_menu_order'];
}
}

if ( $custom_menu_order ) {
add_filter( 'custom_menu_order', '__return_true' );
add_filter( 'menu_order', array( $this, 'set_menu_order' ), 11 );
}
if( apply_filters( 'aioseo_custom_menu_order', true) !== false ){
// API filter hook to disable showing SEO at the top of the menu.
add_filter( 'custom_menu_order', '__return_true' );
add_filter( 'menu_order', array( $this, 'set_menu_order' ), 11 );
}

if ( $donated ) {
// Thank you for your donation.
Expand Down

0 comments on commit dba382f

Please sign in to comment.