Make WordPress Core


Ignore:
Timestamp:
02/09/2020 04:52:28 PM (7 years ago)
Author:
SergeyBiryukov
Message:

Coding Standards: Use Yoda conditions where appropriate.

See #49222.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/plugin.php

    r47198 r47219  
    18351835        }
    18361836
    1837         if ( $pagenow == 'admin.php' && isset( $plugin_page ) ) {
     1837        if ( 'admin.php' === $pagenow && isset( $plugin_page ) ) {
    18381838                foreach ( (array) $menu as $parent_menu ) {
    18391839                        if ( $parent_menu[2] == $plugin_page ) {
     
    18671867                                $parent = $_wp_real_parent_file[ $parent ];
    18681868                        }
    1869                         if ( ! empty( $typenow ) && ( $submenu_array[2] == "$pagenow?post_type=$typenow" ) ) {
     1869                        if ( ! empty( $typenow ) && ( "$pagenow?post_type=$typenow" === $submenu_array[2] ) ) {
    18701870                                $parent_file = $parent;
    18711871                                return $parent;
     
    19361936                                                ( $parent == $plugin_page ) ||
    19371937                                                ( $plugin_page == $hook ) ||
    1938                                                 ( $pagenow == 'admin.php' && $parent1 != $submenu_array[2] ) ||
     1938                                                ( 'admin.php' === $pagenow && $parent1 != $submenu_array[2] ) ||
    19391939                                                ( ! empty( $typenow ) && $parent == $pagenow . '?post_type=' . $typenow )
    19401940                                        )
     
    19611961                                if ( isset( $plugin_page ) &&
    19621962                                        ( $plugin_page == $menu_array[2] ) &&
    1963                                         ( $pagenow == 'admin.php' ) &&
     1963                                        ( 'admin.php' === $pagenow ) &&
    19641964                                        ( $parent1 == $menu_array[2] ) ) {
    19651965                                                $title = $menu_array[3];
     
    21572157 */
    21582158function add_option_whitelist( $new_options, $options = '' ) {
    2159         if ( $options == '' ) {
     2159        if ( '' == $options ) {
    21602160                global $whitelist_options;
    21612161        } else {
     
    21702170                        } else {
    21712171                                $pos = array_search( $key, $whitelist_options[ $page ] );
    2172                                 if ( $pos === false ) {
     2172                                if ( false === $pos ) {
    21732173                                        $whitelist_options[ $page ][] = $key;
    21742174                                }
     
    21922192 */
    21932193function remove_option_whitelist( $del_options, $options = '' ) {
    2194         if ( $options == '' ) {
     2194        if ( '' == $options ) {
    21952195                global $whitelist_options;
    21962196        } else {
     
    22022202                        if ( isset( $whitelist_options[ $page ] ) && is_array( $whitelist_options[ $page ] ) ) {
    22032203                                $pos = array_search( $key, $whitelist_options[ $page ] );
    2204                                 if ( $pos !== false ) {
     2204                                if ( false !== $pos ) {
    22052205                                        unset( $whitelist_options[ $page ][ $pos ] );
    22062206                                }
Note: See TracChangeset for help on using the changeset viewer.