Skip to content

Commit

Permalink
AIOSEOP meta box appears when SEO for post types is disabled awesomem…
Browse files Browse the repository at this point in the history
  • Loading branch information
contactashish13 committed Nov 25, 2017
1 parent 33baf0a commit 2d94b08
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions aioseop_class.php
Expand Up @@ -994,7 +994,8 @@ function __construct() {
'condshow' => array( 'aiosp_disable' => 'on' ),
),
),
'display' => null,
// #1067: if SEO is disabled and an empty array is passed below, it will be overriden. So let's pass a post type that cannot possibly exist.
'display' => 'on' === $aioseop_options['aiosp_enablecpost'] ? $aioseop_options['aiosp_cpostactive'] : array( '___null___' ),
),
);

Expand Down Expand Up @@ -4766,7 +4767,9 @@ function admin_menu() {
$this->locations['aiosp']['display'] = array();
}
}
} else {
// #1067: if SEO was disabled, it was always displaying for post and page. Because we are now sending an invalid post type '___null___' when SEO is disabled,
// this else will be unreachable. Still keeping it in case there is an undiscovered path that needs this condition.
} else if ( empty( $this->locations['aiosp']['display'] ) ) {
$this->locations['aiosp']['display'] = array( 'post', 'page' );
}

Expand Down

0 comments on commit 2d94b08

Please sign in to comment.