Changeset 47808 for trunk/src/wp-includes/theme.php
- Timestamp:
- 05/16/2020 06:40:52 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/theme.php
r47771 r47808 1157 1157 $url = get_theme_mod( 'header_image', get_theme_support( 'custom-header', 'default-image' ) ); 1158 1158 1159 if ( 'remove-header' == $url ) {1159 if ( 'remove-header' === $url ) { 1160 1160 return false; 1161 1161 } … … 1266 1266 $headers = array(); 1267 1267 1268 if ( 'random-uploaded-image' == $header_image_mod ) {1268 if ( 'random-uploaded-image' === $header_image_mod ) { 1269 1269 $headers = get_uploaded_header_images(); 1270 1270 } elseif ( ! empty( $_wp_default_headers ) ) { 1271 if ( 'random-default-image' == $header_image_mod ) {1271 if ( 'random-default-image' === $header_image_mod ) { 1272 1272 $headers = $_wp_default_headers; 1273 1273 } else { … … 1287 1287 $_wp_random_header->thumbnail_url = sprintf( $_wp_random_header->thumbnail_url, get_template_directory_uri(), get_stylesheet_directory_uri() ); 1288 1288 } 1289 1289 1290 return $_wp_random_header; 1290 1291 } … … 1299 1300 function get_random_header_image() { 1300 1301 $random_image = _get_random_header_data(); 1302 1301 1303 if ( empty( $random_image->url ) ) { 1302 1304 return ''; 1303 1305 } 1306 1304 1307 return $random_image->url; 1305 1308 } … … 1320 1323 $header_image_mod = get_theme_mod( 'header_image', get_theme_support( 'custom-header', 'default-image' ) ); 1321 1324 1322 if ( 'any' == $type ) { 1323 if ( 'random-default-image' == $header_image_mod || 'random-uploaded-image' == $header_image_mod || ( '' != get_random_header_image() && empty( $header_image_mod ) ) ) { 1325 if ( 'any' === $type ) { 1326 if ( 'random-default-image' === $header_image_mod 1327 || 'random-uploaded-image' === $header_image_mod 1328 || ( '' !== get_random_header_image() && empty( $header_image_mod ) ) 1329 ) { 1324 1330 return true; 1325 1331 } 1326 1332 } else { 1327 if ( "random-$type-image" == $header_image_mod ) {1333 if ( "random-$type-image" === $header_image_mod ) { 1328 1334 return true; 1329 } elseif ( 'default' == $type && empty( $header_image_mod ) && '' != get_random_header_image() ) {1335 } elseif ( 'default' === $type && empty( $header_image_mod ) && '' !== get_random_header_image() ) { 1330 1336 return true; 1331 1337 } … … 1342 1348 function header_image() { 1343 1349 $image = get_header_image(); 1350 1344 1351 if ( $image ) { 1345 1352 echo esc_url( $image ); … … 1537 1544 function the_header_video_url() { 1538 1545 $video = get_header_video_url(); 1546 1539 1547 if ( $video ) { 1540 1548 echo esc_url( $video ); … … 2904 2912 global $_wp_theme_features; 2905 2913 2906 if ( 'custom-header-uploads' == $feature ) {2914 if ( 'custom-header-uploads' === $feature ) { 2907 2915 return current_theme_supports( 'custom-header', 'uploads' ); 2908 2916 } … … 3075 3083 function _wp_customize_include() { 3076 3084 3077 $is_customize_admin_page = ( is_admin() && 'customize.php' == basename( $_SERVER['PHP_SELF'] ) );3085 $is_customize_admin_page = ( is_admin() && 'customize.php' === basename( $_SERVER['PHP_SELF'] ) ); 3078 3086 $should_include = ( 3079 3087 $is_customize_admin_page 3080 3088 || 3081 ( isset( $_REQUEST['wp_customize'] ) && 'on' == $_REQUEST['wp_customize'] )3089 ( isset( $_REQUEST['wp_customize'] ) && 'on' === $_REQUEST['wp_customize'] ) 3082 3090 || 3083 3091 ( ! empty( $_GET['customize_changeset_uuid'] ) || ! empty( $_POST['customize_changeset_uuid'] ) )
Note: See TracChangeset
for help on using the changeset viewer.