Changeset 47848
- Timestamp:
- 05/23/2020 11:36:36 AM (4 years ago)
- Location:
- trunk/src
- Files:
-
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/bookmark.php
r47808 r47848 199 199 200 200 // Make sure we set a valid category. 201 if ( ! is_array( $link_category ) || 0 == count( $link_category ) ) {201 if ( ! is_array( $link_category ) || 0 === count( $link_category ) ) { 202 202 $link_category = array( get_option( 'default_link_category' ) ); 203 203 } … … 258 258 function wp_set_link_cats( $link_id = 0, $link_categories = array() ) { 259 259 // If $link_categories isn't already an array, make it one: 260 if ( ! is_array( $link_categories ) || 0 == count( $link_categories ) ) {260 if ( ! is_array( $link_categories ) || 0 === count( $link_categories ) ) { 261 261 $link_categories = array( get_option( 'default_link_category' ) ); 262 262 } -
trunk/src/wp-admin/includes/class-wp-upgrader.php
r47808 r47848 499 499 500 500 // Locate which directory to copy to the new folder. This is based on the actual folder holding the files. 501 if ( 1 == count( $source_files ) && $wp_filesystem->is_dir( trailingslashit( $args['source'] ) . $source_files[0] . '/' ) ) {501 if ( 1 === count( $source_files ) && $wp_filesystem->is_dir( trailingslashit( $args['source'] ) . $source_files[0] . '/' ) ) { 502 502 // Only one folder? Then we want its contents. 503 503 $source = trailingslashit( $args['source'] ) . trailingslashit( $source_files[0] ); -
trunk/src/wp-admin/includes/deprecated.php
r47555 r47848 1340 1340 while ( true ) { 1341 1341 // Abort this foreach loop iteration if there's no plugins left of this type. 1342 if ( 0 == count($items) )1342 if ( 0 === count($items) ) 1343 1343 continue 2; 1344 1344 -
trunk/src/wp-admin/includes/file.php
r47808 r47848 1628 1628 } 1629 1629 1630 if ( 0 == count( $archive_files ) ) {1630 if ( 0 === count( $archive_files ) ) { 1631 1631 return new WP_Error( 'empty_archive_pclzip', __( 'Empty archive.' ) ); 1632 1632 } -
trunk/src/wp-admin/includes/menu.php
r47808 r47848 169 169 * remove the submenu. 170 170 */ 171 if ( ! empty( $submenu[ $data[2] ] ) && 1 == count( $submenu[ $data[2] ] ) ) {171 if ( ! empty( $submenu[ $data[2] ] ) && 1 === count( $submenu[ $data[2] ] ) ) { 172 172 $subs = $submenu[ $data[2] ]; 173 173 $first_sub = reset( $subs ); -
trunk/src/wp-admin/includes/ms.php
r47808 r47848 857 857 <h1><?php esc_html_e( 'Users' ); ?></h1> 858 858 859 <?php if ( 1 == count( $users ) ) : ?>859 <?php if ( 1 === count( $users ) ) : ?> 860 860 <p><?php _e( 'You have chosen to delete the user from all networks and sites.' ); ?></p> 861 861 <?php else : ?> … … 975 975 do_action( 'delete_user_form', $current_user, $allusers ); 976 976 977 if ( 1 == count( $users ) ) :977 if ( 1 === count( $users ) ) : 978 978 ?> 979 979 <p><?php _e( 'Once you hit “Confirm Deletion”, the user will be permanently removed.' ); ?></p> -
trunk/src/wp-admin/nav-menus.php
r47808 r47848 424 424 $locations_screen = ( isset( $_GET['action'] ) && 'locations' === $_GET['action'] ) ? true : false; 425 425 426 $page_count = wp_count_posts( 'page' ); 427 426 428 /* 427 429 * If we have one theme location, and zero menus, we take them right 428 430 * into editing their first menu. 429 431 */ 430 $page_count = wp_count_posts( 'page' ); 431 $one_theme_location_no_menus = ( 1 == count( get_registered_nav_menus() ) && ! $add_new_screen && empty( $nav_menus ) && ! empty( $page_count->publish ) ) ? true : false; 432 if ( 1 === count( get_registered_nav_menus() ) && ! $add_new_screen 433 && empty( $nav_menus ) && ! empty( $page_count->publish ) 434 ) { 435 $one_theme_location_no_menus = true; 436 } else { 437 $one_theme_location_no_menus = false; 438 } 432 439 433 440 $nav_menus_l10n = array( … … 929 936 <?php 930 937 $hide_style = ''; 931 if ( isset( $menu_items ) && 0 == count( $menu_items ) ) {938 if ( isset( $menu_items ) && 0 === count( $menu_items ) ) { 932 939 $hide_style = 'style="display: none;"'; 933 940 } -
trunk/src/wp-admin/network.php
r47808 r47848 100 100 $result = populate_network( 1, get_clean_basedomain(), sanitize_email( $_POST['email'] ), wp_unslash( $_POST['sitename'] ), $base, $subdomain_install ); 101 101 if ( is_wp_error( $result ) ) { 102 if ( 1 == count( $result->get_error_codes() ) && 'no_wildcard_dns' === $result->get_error_code() ) {102 if ( 1 === count( $result->get_error_codes() ) && 'no_wildcard_dns' === $result->get_error_code() ) { 103 103 network_step2( $result ); 104 104 } else { -
trunk/src/wp-admin/themes.php
r47835 r47848 286 286 /* 287 287 // Certain error codes are less fatal than others. We can still display theme information in most cases. 288 if ( ! $ct->errors() || ( 1 == count( $ct->errors()->get_error_codes() )288 if ( ! $ct->errors() || ( 1 === count( $ct->errors()->get_error_codes() ) 289 289 && in_array( $ct->errors()->get_error_code(), array( 'theme_no_parent', 'theme_parent_invalid', 'theme_no_index' ) ) ) ) : ?> 290 290 */ -
trunk/src/wp-admin/update-core.php
r47835 r47848 47 47 } elseif ( 'en_US' === $update->locale && $update->packages->partial && $wp_version == $update->partial_version ) { 48 48 $updates = get_core_updates(); 49 if ( $updates && 1 == count( $updates ) ) {49 if ( $updates && 1 === count( $updates ) ) { 50 50 // If the only available update is a partial builds, it doesn't need a language-specific version string. 51 51 $version_string = $update->current; -
trunk/src/wp-admin/users.php
r47557 r47848 279 279 <?php endif; ?> 280 280 281 <?php if ( 1 == count( $all_userids ) ) : ?>281 <?php if ( 1 === count( $all_userids ) ) : ?> 282 282 <p><?php _e( 'You have specified this user for deletion:' ); ?></p> 283 283 <?php else : ?> … … 416 416 <h1><?php _e( 'Remove Users from Site' ); ?></h1> 417 417 418 <?php if ( 1 == count( $userids ) ) : ?>418 <?php if ( 1 === count( $userids ) ) : ?> 419 419 <p><?php _e( 'You have specified this user for removal:' ); ?></p> 420 420 <?php else : ?> -
trunk/src/wp-includes/class-wp-user.php
r47808 r47848 591 591 */ 592 592 public function set_role( $role ) { 593 if ( 1 == count( $this->roles ) && current( $this->roles ) == $role ) {593 if ( 1 === count( $this->roles ) && current( $this->roles ) == $role ) { 594 594 return; 595 595 } -
trunk/src/wp-includes/formatting.php
r47808 r47848 407 407 $opening_tag = true; 408 408 $name_offset = 1; 409 } elseif ( 0 == count( $stack ) ) {409 } elseif ( 0 === count( $stack ) ) { 410 410 // Stack is empty. Just stop. 411 411 return; -
trunk/src/wp-includes/post-template.php
r47808 r47848 1073 1073 if ( ! isset( $custom[ $key ] ) ) { 1074 1074 return false; 1075 } elseif ( 1 == count( $custom[ $key ] ) ) {1075 } elseif ( 1 === count( $custom[ $key ] ) ) { 1076 1076 return $custom[ $key ][0]; 1077 1077 } else { -
trunk/src/wp-includes/post.php
r47808 r47848 3710 3710 3711 3711 // Make sure we set a valid category. 3712 if ( empty( $post_category ) || 0 == count( $post_category ) || ! is_array( $post_category ) ) {3712 if ( empty( $post_category ) || 0 === count( $post_category ) || ! is_array( $post_category ) ) { 3713 3713 // 'post' requires at least one category. 3714 3714 if ( 'post' === $post_type && 'auto-draft' !== $post_status ) { … … 4685 4685 $post_categories = array(); 4686 4686 } 4687 } elseif ( 1 == count( $post_categories ) && '' === reset( $post_categories ) ) {4687 } elseif ( 1 === count( $post_categories ) && '' === reset( $post_categories ) ) { 4688 4688 return true; 4689 4689 } … … 5440 5440 } 5441 5441 5442 if ( 1 == count( $post_status ) ) {5442 if ( 1 === count( $post_status ) ) { 5443 5443 $where_post_type = $wpdb->prepare( 'post_type = %s AND post_status = %s', $parsed_args['post_type'], reset( $post_status ) ); 5444 5444 } else {
Note: See TracChangeset
for help on using the changeset viewer.