Changeset 56194
- Timestamp:
- 07/10/2023 11:09:16 PM (14 months ago)
- Location:
- trunk/src/wp-includes
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/rewrite.php
r55988 r56194 599 599 foreach ( (array) $rewrite as $match => $query ) { 600 600 601 // If the requesting file is the anchor of the match, 602 // prepend it to the path info. 601 /* 602 * If the requesting file is the anchor of the match, 603 * prepend it to the path info. 604 */ 603 605 if ( ! empty( $url ) && ( $url != $request ) && str_starts_with( $match, $url ) ) { 604 606 $request_match = $url . '/' . $request; … … 621 623 } 622 624 623 // Got a match. 624 // Trim the query of everything up to the '?'. 625 /* 626 * Got a match. 627 * Trim the query of everything up to the '?'. 628 */ 625 629 $query = preg_replace( '!^.+\?!', '', $query ); 626 630 -
trunk/src/wp-includes/script-loader.php
r56139 r56194 58 58 && false !== stripos( $_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip' ) && ! $force_uncompressed; 59 59 60 // Load tinymce.js when running from /src, otherwise load wp-tinymce.js.gz (in production) 61 // or tinymce.min.js (when SCRIPT_DEBUG is true). 60 /* 61 * Load tinymce.js when running from /src, otherwise load wp-tinymce.js.gz (in production) 62 * or tinymce.min.js (when SCRIPT_DEBUG is true). 63 */ 62 64 if ( $compressed ) { 63 65 $scripts->add( 'wp-tinymce', includes_url( 'js/tinymce/' ) . 'wp-tinymce.js', array(), $tinymce_version ); … … 586 588 $tinymce_settings = apply_filters( 'tiny_mce_before_init', $tinymce_settings, 'classic-block' ); 587 589 588 // Do "by hand" translation from PHP array to js object. 589 // Prevents breakage in some custom settings. 590 /* 591 * Do "by hand" translation from PHP array to js object. 592 * Prevents breakage in some custom settings. 593 */ 590 594 $init_obj = ''; 591 595 foreach ( $tinymce_settings as $key => $value ) { … … 826 830 $scripts->add( 'cropper', '/wp-includes/js/crop/cropper.js', array( 'scriptaculous-dragdrop' ) ); 827 831 828 // jQuery. 829 // The unminified jquery.js and jquery-migrate.js are included to facilitate debugging. 832 /* 833 * jQuery. 834 * The unminified jquery.js and jquery-migrate.js are included to facilitate debugging. 835 */ 830 836 $scripts->add( 'jquery', false, array( 'jquery-core', 'jquery-migrate' ), '3.7.0' ); 831 837 $scripts->add( 'jquery-core', "/wp-includes/js/jquery/jquery$suffix.js", array(), '3.7.0' ); 832 838 $scripts->add( 'jquery-migrate', "/wp-includes/js/jquery/jquery-migrate$suffix.js", array(), '3.4.1' ); 833 839 834 // Full jQuery UI. 835 // The build process in 1.12.1 has changed significantly. 836 // In order to keep backwards compatibility, and to keep the optimized loading, 837 // the source files were flattened and included with some modifications for AMD loading. 838 // A notable change is that 'jquery-ui-core' now contains 'jquery-ui-position' and 'jquery-ui-widget'. 840 /* 841 * Full jQuery UI. 842 * The build process in 1.12.1 has changed significantly. 843 * In order to keep backwards compatibility, and to keep the optimized loading, 844 * the source files were flattened and included with some modifications for AMD loading. 845 * A notable change is that 'jquery-ui-core' now contains 'jquery-ui-position' and 'jquery-ui-widget'. 846 */ 839 847 $scripts->add( 'jquery-ui-core', "/wp-includes/js/jquery/ui/core$suffix.js", array( 'jquery' ), '1.13.2', 1 ); 840 848 $scripts->add( 'jquery-effects-core', "/wp-includes/js/jquery/ui/effect$suffix.js", array( 'jquery' ), '1.13.2', 1 ); … … 882 890 $scripts->add( 'jquery-ui-sortable', "/wp-includes/js/jquery/ui/sortable$suffix.js", array( 'jquery-ui-mouse' ), '1.13.2', 1 ); 883 891 884 // As of 1.12.1 `jquery-ui-position` and `jquery-ui-widget` are part of `jquery-ui-core`. 885 // Listed here for back-compat. 892 /* 893 * As of 1.12.1 `jquery-ui-position` and `jquery-ui-widget` are part of `jquery-ui-core`. 894 * Listed here for back-compat. 895 */ 886 896 $scripts->add( 'jquery-ui-position', false, array( 'jquery-ui-core' ), '1.13.2', 1 ); 887 897 $scripts->add( 'jquery-ui-widget', false, array( 'jquery-ui-core' ), '1.13.2', 1 ); … … 916 926 $scripts->add( 'suggest', "/wp-includes/js/jquery/suggest$suffix.js", array( 'jquery' ), '1.1-20110113', 1 ); 917 927 918 // Masonry v2 depended on jQuery. v3 does not. The older jquery-masonry handle is a shiv. 919 // It sets jQuery as a dependency, as the theme may have been implicitly loading it this way. 928 /* 929 * Masonry v2 depended on jQuery. v3 does not. The older jquery-masonry handle is a shiv. 930 * It sets jQuery as a dependency, as the theme may have been implicitly loading it this way. 931 */ 920 932 $scripts->add( 'imagesloaded', '/wp-includes/js/imagesloaded.min.js', array(), '4.1.4', 1 ); 921 933 $scripts->add( 'masonry', '/wp-includes/js/masonry.min.js', array( 'imagesloaded' ), '4.2.2', 1 ); … … 1339 1351 $scripts->add( 'wp-embed', "/wp-includes/js/wp-embed$suffix.js", array(), false, 1 ); 1340 1352 1341 // To enqueue media-views or media-editor, call wp_enqueue_media(). 1342 // Both rely on numerous settings, styles, and templates to operate correctly. 1353 /* 1354 * To enqueue media-views or media-editor, call wp_enqueue_media(). 1355 * Both rely on numerous settings, styles, and templates to operate correctly. 1356 */ 1343 1357 $scripts->add( 'media-views', "/wp-includes/js/media-views$suffix.js", array( 'utils', 'media-models', 'wp-plupload', 'jquery-ui-sortable', 'wp-mediaelement', 'wp-api-request', 'wp-a11y', 'clipboard' ), false, 1 ); 1344 1358 $scripts->set_translations( 'media-views' ); … … 1636 1650 'wp-components', 1637 1651 'wp-editor', 1638 // This need to be added before the block library styles, 1639 // The block library styles override the "reset" styles. 1652 /* 1653 * This needs to be added before the block library styles, 1654 * The block library styles override the "reset" styles. 1655 */ 1640 1656 'wp-reset-editor-styles', 1641 1657 'wp-block-library', … … 2715 2731 $attributes_string = ''; 2716 2732 2717 // If HTML5 script tag is supported, only the attribute name is added 2718 // to $attributes_string for entries with a boolean value, and that are true. 2733 /* 2734 * If HTML5 script tag is supported, only the attribute name is added 2735 * to $attributes_string for entries with a boolean value, and that are true. 2736 */ 2719 2737 foreach ( $attributes as $attribute_name => $attribute_value ) { 2720 2738 if ( is_bool( $attribute_value ) ) { … … 2897 2915 $style['css'] = file_get_contents( $style['path'] ); 2898 2916 2899 // Check if the style contains relative URLs that need to be modified. 2900 // URLs relative to the stylesheet's path should be converted to relative to the site's root. 2917 /* 2918 * Check if the style contains relative URLs that need to be modified. 2919 * URLs relative to the stylesheet's path should be converted to relative to the site's root. 2920 */ 2901 2921 $style['css'] = _wp_normalize_relative_css_links( $style['css'], $style['src'] ); 2902 2922 … … 3711 3731 $classic_theme_styles = ABSPATH . WPINC . "/css/classic-themes$suffix.css"; 3712 3732 3713 // This follows the pattern of get_block_editor_theme_styles, 3714 // but we can't use get_block_editor_theme_styles directly as it 3715 // only handles external files or theme files. 3733 /* 3734 * This follows the pattern of get_block_editor_theme_styles, 3735 * but we can't use get_block_editor_theme_styles directly as it 3736 * only handles external files or theme files. 3737 */ 3716 3738 $classic_theme_styles_settings = array( 3717 3739 'css' => file_get_contents( $classic_theme_styles ), -
trunk/src/wp-includes/shortcodes.php
r55990 r56194 264 264 $tagregexp = implode( '|', array_map( 'preg_quote', $tagnames ) ); 265 265 266 // WARNING! Do not change this regex without changing do_shortcode_tag() and strip_shortcode_tag(). 267 // Also, see shortcode_unautop() and shortcode.js. 266 /* 267 * WARNING! Do not change this regex without changing do_shortcode_tag() and strip_shortcode_tag(). 268 * Also, see shortcode_unautop() and shortcode.js. 269 */ 268 270 269 271 // phpcs:disable Squiz.Strings.ConcatenationSpacing.PaddingFound -- don't remove regex indentation … … 467 469 $attr = preg_replace_callback( "/$pattern/", 'do_shortcode_tag', $attr ); 468 470 } else { 469 // $attr like 'name = "[shortcode]"' or "name = '[shortcode]'". 470 // We do not know if $content was unfiltered. Assume KSES ran before shortcodes. 471 /* 472 * $attr like 'name = "[shortcode]"' or "name = '[shortcode]'". 473 * We do not know if $content was unfiltered. Assume KSES ran before shortcodes. 474 */ 471 475 $count = 0; 472 476 $new_attr = preg_replace_callback( "/$pattern/", 'do_shortcode_tag', $attr, -1, $count ); -
trunk/src/wp-includes/taxonomy.php
r55921 r56194 3251 3251 $duplicate = get_term_by( 'slug', $slug, $taxonomy ); 3252 3252 if ( $duplicate && $duplicate->term_id !== $term_id ) { 3253 // If an empty slug was passed or the parent changed, reset the slug to something unique. 3254 // Otherwise, bail. 3253 /* 3254 * If an empty slug was passed or the parent changed, reset the slug to something unique. 3255 * Otherwise, bail. 3256 */ 3255 3257 if ( $empty_slug || ( $parent !== (int) $term['parent'] ) ) { 3256 3258 $slug = wp_unique_term_slug( $slug, (object) $args ); -
trunk/src/wp-includes/template.php
r55988 r56194 471 471 472 472 if ( ! $pagename && $id ) { 473 // If a static page is set as the front page, $pagename will not be set. 474 // Retrieve it from the queried object. 473 /* 474 * If a static page is set as the front page, $pagename will not be set. 475 * Retrieve it from the queried object. 476 */ 475 477 $post = get_queried_object(); 476 478 if ( $post ) { -
trunk/src/wp-includes/theme-templates.php
r55365 r56194 174 174 } 175 175 176 // Get the site wrapper. 177 // The skip-link will be injected in the beginning of it. 176 /* 177 * Get the site wrapper. 178 * The skip-link will be injected in the beginning of it. 179 */ 178 180 sibling = document.querySelector( '.wp-site-blocks' ); 179 181 -
trunk/src/wp-includes/theme.php
r56142 r56194 46 46 47 47 if ( is_array( $wp_theme_directories ) && count( $wp_theme_directories ) > 1 ) { 48 // Make sure the active theme wins out, in case search_theme_directories() picks the wrong 49 // one in the case of a conflict. (Normally, last registered theme root wins.) 48 /* 49 * Make sure the active theme wins out, in case search_theme_directories() picks the wrong 50 * one in the case of a conflict. (Normally, last registered theme root wins.) 51 */ 50 52 $current_theme = get_stylesheet(); 51 53 if ( isset( $theme_directories[ $current_theme ] ) ) { … … 511 513 } 512 514 if ( file_exists( $theme_root . '/' . $dir . '/style.css' ) ) { 513 // wp-content/themes/a-single-theme 514 // wp-content/themes is $theme_root, a-single-theme is $dir. 515 /* 516 * wp-content/themes/a-single-theme 517 * wp-content/themes is $theme_root, a-single-theme is $dir. 518 */ 515 519 $found_themes[ $dir ] = array( 516 520 'theme_file' => $dir . '/style.css', … … 519 523 } else { 520 524 $found_theme = false; 521 // wp-content/themes/a-folder-of-themes/* 522 // wp-content/themes is $theme_root, a-folder-of-themes is $dir, then themes are $sub_dirs. 525 /* 526 * wp-content/themes/a-folder-of-themes/* 527 * wp-content/themes is $theme_root, a-folder-of-themes is $dir, then themes are $sub_dirs. 528 */ 523 529 $sub_dirs = @ scandir( $theme_root . '/' . $dir ); 524 530 if ( ! $sub_dirs ) { … … 539 545 $found_theme = true; 540 546 } 541 // Never mind the above, it's just a theme missing a style.css. 542 // Return it; WP_Theme will catch the error. 547 /* 548 * Never mind the above, it's just a theme missing a style.css. 549 * Return it; WP_Theme will catch the error. 550 */ 543 551 if ( ! $found_theme ) { 544 552 $found_themes[ $dir ] = array( … … 588 596 $theme_root = get_raw_theme_root( $stylesheet_or_template ); 589 597 if ( $theme_root ) { 590 // Always prepend WP_CONTENT_DIR unless the root currently registered as a theme directory. 591 // This gives relative theme roots the benefit of the doubt when things go haywire. 598 /* 599 * Always prepend WP_CONTENT_DIR unless the root currently registered as a theme directory. 600 * This gives relative theme roots the benefit of the doubt when things go haywire. 601 */ 592 602 if ( ! in_array( $theme_root, (array) $wp_theme_directories, true ) ) { 593 603 $theme_root = WP_CONTENT_DIR . $theme_root; … … 1833 1843 $background = set_url_scheme( get_background_image() ); 1834 1844 1835 // $color is the saved custom color. 1836 // A default has to be specified in style.css. It will not be printed here. 1845 /* 1846 * $color is the saved custom color. 1847 * A default has to be specified in style.css. It will not be printed here. 1848 */ 1837 1849 $color = get_background_color(); 1838 1850 … … 2508 2520 break; 2509 2521 2510 // All that's left now are posts (besides attachments). 2511 // Not a default case for the sake of clarity and future work. 2522 /* 2523 * All that's left now are posts (besides attachments). 2524 * Not a default case for the sake of clarity and future work. 2525 */ 2512 2526 case 'posts': 2513 2527 foreach ( $config[ $type ] as $id => $item ) { … … 2736 2750 unset( $args[0]['__jit'] ); 2737 2751 2738 // Merge in data from previous add_theme_support() calls. 2739 // The first value registered wins. (A child theme is set up first.) 2752 /* 2753 * Merge in data from previous add_theme_support() calls. 2754 * The first value registered wins. (A child theme is set up first.) 2755 */ 2740 2756 if ( isset( $_wp_theme_features['custom-header'] ) ) { 2741 2757 $args[0] = wp_parse_args( $_wp_theme_features['custom-header'][0], $args[0] ); 2742 2758 } 2743 2759 2744 // Load in the defaults at the end, as we need to insure first one wins. 2745 // This will cause all constants to be defined, as each arg will then be set to the default. 2760 /* 2761 * Load in the defaults at the end, as we need to insure first one wins. 2762 * This will cause all constants to be defined, as each arg will then be set to the default. 2763 */ 2746 2764 if ( $jit ) { 2747 2765 $args[0] = wp_parse_args( $args[0], $defaults ); … … 2790 2808 } 2791 2809 2792 // If headers are supported, and we still don't have a defined width or height, 2793 // we have implicit flex sizes. 2810 /* 2811 * If headers are supported, and we still don't have a defined width or height, 2812 * we have implicit flex sizes. 2813 */ 2794 2814 if ( $jit ) { 2795 2815 if ( empty( $args[0]['width'] ) && empty( $args[0]['flex-width'] ) ) { … … 3488 3508 $messenger_channel = null; 3489 3509 3490 // Value false indicates UUID should be determined after_setup_theme 3491 // to either re-use existing saved changeset or else generate a new UUID if none exists. 3510 /* 3511 * Value false indicates UUID should be determined after_setup_theme 3512 * to either re-use existing saved changeset or else generate a new UUID if none exists. 3513 */ 3492 3514 $changeset_uuid = false; 3493 3515 3494 // Set initially fo false since defaults to true for back-compat; 3495 // can be overridden via the customize_changeset_branching filter. 3516 /* 3517 * Set initially fo false since defaults to true for back-compat; 3518 * can be overridden via the customize_changeset_branching filter. 3519 */ 3496 3520 $branching = false; 3497 3521 -
trunk/src/wp-includes/user.php
r56151 r56194 1066 1066 } 1067 1067 1068 // Technically not needed, but does save calls to get_site() and get_user_meta() 1069 // in the event that the function is called when a user isn't logged in. 1068 /* 1069 * Technically not needed, but does save calls to get_site() and get_user_meta() 1070 * in the event that the function is called when a user isn't logged in. 1071 */ 1070 1072 if ( empty( $user_id ) ) { 1071 1073 return false; … … 2724 2726 wp_clear_auth_cookie(); 2725 2727 2726 // Here we calculate the expiration length of the current auth cookie and compare it to the default expiration. 2727 // If it's greater than this, then we know the user checked 'Remember Me' when they logged in. 2728 /* 2729 * Here we calculate the expiration length of the current auth cookie and compare it to the default expiration. 2730 * If it's greater than this, then we know the user checked 'Remember Me' when they logged in. 2731 */ 2728 2732 $logged_in_cookie = wp_parse_auth_cookie( '', 'logged_in' ); 2729 2733 /** This filter is documented in wp-includes/pluggable.php */ -
trunk/src/wp-includes/widgets.php
r55990 r56194 186 186 } 187 187 188 // Custom specified ID's are suffixed if they exist already. 189 // Automatically generated sidebar names need to be suffixed regardless starting at -0. 188 /* 189 * Custom specified ID's are suffixed if they exist already. 190 * Automatically generated sidebar names need to be suffixed regardless starting at -0. 191 */ 190 192 if ( isset( $args['id'] ) ) { 191 193 $_args['id'] = $args['id']; … … 1014 1016 global $_wp_sidebars_widgets, $sidebars_widgets; 1015 1017 1016 // If loading from front page, consult $_wp_sidebars_widgets rather than options 1017 // to see if wp_convert_widget_settings() has made manipulations in memory. 1018 /* 1019 * If loading from front page, consult $_wp_sidebars_widgets rather than options 1020 * to see if wp_convert_widget_settings() has made manipulations in memory. 1021 */ 1018 1022 if ( ! is_admin() ) { 1019 1023 if ( empty( $_wp_sidebars_widgets ) ) {
Note: See TracChangeset
for help on using the changeset viewer.