Skip to content

Commit

Permalink
Simplify should_show_in_menu return condition
Browse files Browse the repository at this point in the history
  • Loading branch information
westonruter committed Aug 29, 2018
1 parent 0e9bf1b commit a83a569
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
5 changes: 1 addition & 4 deletions includes/validation/class-amp-invalid-url-post-type.php
Original file line number Diff line number Diff line change
Expand Up @@ -119,10 +119,7 @@ public static function should_show_in_menu() {
if ( current_theme_supports( 'amp' ) ) {
return true;
}
if ( 'edit.php' === $pagenow && ( isset( $_GET['post_type'] ) && self::POST_TYPE_SLUG === $_GET['post_type'] ) ) { // WPCS: CSRF OK.
return true;
}
return false;
return ( 'edit.php' === $pagenow && ( isset( $_GET['post_type'] ) && self::POST_TYPE_SLUG === $_GET['post_type'] ) ); // WPCS: CSRF OK.
}

/**
Expand Down
5 changes: 1 addition & 4 deletions includes/validation/class-amp-validation-error-taxonomy.php
Original file line number Diff line number Diff line change
Expand Up @@ -172,10 +172,7 @@ public static function should_show_in_menu() {
if ( current_theme_supports( 'amp' ) ) {
return true;
}
if ( 'edit-tags.php' === $pagenow && ( isset( $_GET['taxonomy'] ) && self::TAXONOMY_SLUG === $_GET['taxonomy'] ) ) { // WPCS: CSRF OK.
return true;
}
return false;
return ( 'edit-tags.php' === $pagenow && ( isset( $_GET['taxonomy'] ) && self::TAXONOMY_SLUG === $_GET['taxonomy'] ) ); // WPCS: CSRF OK.
}

/**
Expand Down

0 comments on commit a83a569

Please sign in to comment.