Changeset 54855
- Timestamp:
- 11/17/2022 06:13:47 PM (22 months ago)
- Location:
- trunk
- Files:
-
- 20 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/js/_enqueues/lib/nav-menu.js
r54316 r54855 1558 1558 }); 1559 1559 1560 // Show bulk action 1560 // Show bulk action. 1561 1561 $( document ).on( 'menu-item-added', function() { 1562 1562 if ( ! $( '.bulk-actions' ).is( ':visible' ) ) { … … 1565 1565 } ); 1566 1566 1567 // Hide bulk action 1567 // Hide bulk action. 1568 1568 $( document ).on( 'menu-removing-item', function( e, el ) { 1569 1569 var menuElement = $( el ).parents( '#menu-to-edit' ); -
trunk/src/wp-includes/class-wp-list-util.php
r54133 r54855 208 208 * 209 209 * @param string|array $orderby Optional. Either the field name to order by or an array 210 * of multiple orderby fields as $orderby => $order. 211 * @param string $order Optional. Either 'ASC' or 'DESC'. Only used if $orderby 212 * is a string. 210 * of multiple orderby fields as `$orderby => $order`. 211 * Default empty array. 212 * @param string $order Optional. Either 'ASC' or 'DESC'. Only used if `$orderby` 213 * is a string. Default 'ASC'. 213 214 * @param bool $preserve_keys Optional. Whether to preserve keys. Default false. 214 215 * @return array The sorted array. -
trunk/src/wp-includes/compat.php
r53365 r54855 157 157 * Internal compat function to mimic mb_strlen(). 158 158 * 159 * Only understands UTF-8 and 8bit. 159 * Only understands UTF-8 and 8bit. All other character sets will be treated as 8bit. 160 160 * For `$encoding === UTF-8`, the `$str` input is expected to be a valid UTF-8 byte 161 161 * sequence. The behavior of this function for invalid inputs is undefined. -
trunk/src/wp-includes/functions.php
r54797 r54855 935 935 * 936 936 * @param string[] $post_links An array of enclosure links. 937 * @param int $post_ IDPost ID.937 * @param int $post_id Post ID. 938 938 */ 939 939 $post_links = apply_filters( 'enclosure_links', $post_links, $post->ID ); … … 3331 3331 * 3332 3332 * @param string[] $wp_get_mime_types Mime types keyed by the file extension regex 3333 * corresponding to those types.3333 * corresponding to those types. 3334 3334 */ 3335 3335 return apply_filters( … … 5201 5201 * @param array $list An array of objects or arrays to sort. 5202 5202 * @param string|array $orderby Optional. Either the field name to order by or an array 5203 * of multiple orderby fields as $orderby => $order. 5204 * @param string $order Optional. Either 'ASC' or 'DESC'. Only used if $orderby 5205 * is a string. 5203 * of multiple orderby fields as `$orderby => $order`. 5204 * Default empty array. 5205 * @param string $order Optional. Either 'ASC' or 'DESC'. Only used if `$orderby` 5206 * is a string. Default 'ASC'. 5206 5207 * @param bool $preserve_keys Optional. Whether to preserve keys. Default false. 5207 5208 * @return array The sorted array. -
trunk/src/wp-includes/l10n.php
r54669 r54855 177 177 * 178 178 * @since 2.2.0 179 * @since 5.5.0 Introduced gettext-{$domain}filter.179 * @since 5.5.0 Introduced `gettext-{$domain}` filter. 180 180 * 181 181 * @param string $text Text to translate. … … 243 243 * 244 244 * @since 2.8.0 245 * @since 5.5.0 Introduced gettext_with_context-{$domain}filter.245 * @since 5.5.0 Introduced `gettext_with_context-{$domain}` filter. 246 246 * 247 247 * @param string $text Text to translate. … … 464 464 * 465 465 * @since 2.8.0 466 * @since 5.5.0 Introduced ngettext-{$domain}filter.466 * @since 5.5.0 Introduced `ngettext-{$domain}` filter. 467 467 * 468 468 * @param string $single The text to be used if the number is singular. … … 522 522 * 523 523 * @since 2.8.0 524 * @since 5.5.0 Introduced ngettext_with_context-{$domain}filter.524 * @since 5.5.0 Introduced `ngettext_with_context-{$domain}` filter. 525 525 * 526 526 * @param string $single The text to be used if the number is singular. … … 1023 1023 1024 1024 /** 1025 * Loads the child theme s translated strings.1026 * 1027 * If the current locale exists as a .mo file in the child theme s1025 * Loads the child theme's translated strings. 1026 * 1027 * If the current locale exists as a .mo file in the child theme's 1028 1028 * root directory, it will be included in the translated strings by the $domain. 1029 1029 * … … 1362 1362 * @param string $dir A directory to search for language files. 1363 1363 * Default WP_LANG_DIR. 1364 * @return string[] An array of language codes or an empty array if no languages are present. Language codes are formed by stripping the .mo extension from the language file names. 1364 * @return string[] An array of language codes or an empty array if no languages are present. 1365 * Language codes are formed by stripping the .mo extension from the language file names. 1365 1366 */ 1366 1367 function get_available_languages( $dir = null ) { -
trunk/src/wp-includes/load.php
r54803 r54855 1323 1323 * 1324 1324 * @global WP_Textdomain_Registry $wp_textdomain_registry WordPress Textdomain Registry. 1325 * @global WP_Locale $wp_localeWordPress date and time locale object.1325 * @global WP_Locale $wp_locale WordPress date and time locale object. 1326 1326 */ 1327 1327 function wp_load_translations_early() { 1328 global $wp_ locale, $wp_textdomain_registry;1328 global $wp_textdomain_registry, $wp_locale; 1329 1329 1330 1330 static $loaded = false; -
trunk/src/wp-includes/post.php
r54854 r54855 1548 1548 * @global array $wp_post_types List of post types. 1549 1549 * 1550 * @param string $post_type Post type key. Must not exceed 20 characters and may 1551 * only contain lowercase alphanumeric characters, dashes, 1552 * and underscores. See sanitize_key(). 1550 * @param string $post_type Post type key. Must not exceed 20 characters and may only contain 1551 * lowercase alphanumeric characters, dashes, and underscores. See sanitize_key(). 1553 1552 * @param array|string $args { 1554 1553 * Array or string of arguments for registering a post type. … … 4199 4198 if ( $update && strtolower( urlencode( $post_name ) ) == $check_name && get_post_field( 'post_name', $post_ID ) == $check_name ) { 4200 4199 $post_name = $check_name; 4201 } else { // new post, or slug has changed.4200 } else { // New post, or slug has changed. 4202 4201 $post_name = sanitize_title( $post_name ); 4203 4202 } -
trunk/src/wp-includes/rest-api/class-wp-rest-server.php
r54663 r54855 554 554 * 555 555 * @since 4.4.0 556 * @since 5.4.0 The $embedparameter can now contain a list of link relations to include.556 * @since 5.4.0 The `$embed` parameter can now contain a list of link relations to include. 557 557 * 558 558 * @param WP_REST_Response $response Response object. … … 678 678 * 679 679 * @since 4.4.0 680 * @since 5.4.0 The $embedparameter can now contain a list of link relations to include.680 * @since 5.4.0 The `$embed` parameter can now contain a list of link relations to include. 681 681 * 682 682 * @param array $data Data from the request. … … 760 760 * 761 761 * @since 4.4.0 762 * @since 6.0.0 The $embed parameter can now contain a list of link relations to include762 * @since 6.0.0 The `$embed` parameter can now contain a list of link relations to include. 763 763 * 764 764 * @param WP_REST_Response $response Response object. -
trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php
r54754 r54855 660 660 ) { 661 661 /* 662 * `wp_unique_post_slug()` returns the same 663 * slug for 'draft' or 'pending' posts. 662 * `wp_unique_post_slug()` returns the same slug for 'draft' or 'pending' posts. 664 663 * 665 * To ensure that a unique slug is generated, 666 * pass the post data with the 'publish' status. 664 * To ensure that a unique slug is generated, pass the post data with the 'publish' status. 667 665 */ 668 666 $prepared_post->post_name = wp_unique_post_slug( … … 863 861 864 862 /* 865 * `wp_unique_post_slug()` returns the same 866 * slug for 'draft' or 'pending' posts. 867 * 868 * To ensure that a unique slug is generated, 869 * pass the post data with the 'publish' status. 863 * `wp_unique_post_slug()` returns the same slug for 'draft' or 'pending' posts. 864 * 865 * To ensure that a unique slug is generated, pass the post data with the 'publish' status. 870 866 */ 871 867 if ( ! empty( $post->post_name ) && in_array( $post_status, array( 'draft', 'pending' ), true ) ) { 872 868 $post_parent = ! empty( $post->post_parent ) ? $post->post_parent : 0; 873 $post->post_name = wp_unique_post_slug( $post->post_name, $post->ID, 'publish', $post->post_type, $post_parent ); 869 $post->post_name = wp_unique_post_slug( 870 $post->post_name, 871 $post->ID, 872 'publish', 873 $post->post_type, 874 $post_parent 875 ); 874 876 } 875 877 -
trunk/src/wp-includes/sitemaps/providers/class-wp-sitemaps-posts.php
r53551 r54855 222 222 'update_post_term_cache' => false, 223 223 'update_post_meta_cache' => false, 224 'ignore_sticky_posts' => true, // sticky posts will still appear, but they won't be moved to the front.224 'ignore_sticky_posts' => true, // Sticky posts will still appear, but they won't be moved to the front. 225 225 ), 226 226 $post_type -
trunk/src/wp-includes/taxonomy.php
r54810 r54855 391 391 * @global WP_Taxonomy[] $wp_taxonomies Registered taxonomies. 392 392 * 393 * @param string $taxonomy Taxonomy key , must not exceed 32 characters and may only contain lowercase alphanumeric394 * characters, dashes, and underscores. See sanitize_key().393 * @param string $taxonomy Taxonomy key. Must not exceed 32 characters and may only contain 394 * lowercase alphanumeric characters, dashes, and underscores. See sanitize_key(). 395 395 * @param array|string $object_type Object type or array of object types with which the taxonomy should be associated. 396 396 * @param array|string $args { -
trunk/src/wp-includes/theme.php
r54419 r54855 3568 3568 $wp_customize->register_controls(); 3569 3569 3570 /** This filter is documented in /wp-includes/class-wp-customize-manager.php */3570 /** This filter is documented in wp-includes/class-wp-customize-manager.php */ 3571 3571 do_action( 'customize_register', $wp_customize ); 3572 3572 } -
trunk/tests/phpunit/includes/utils.php
r53856 r54855 460 460 461 461 /** 462 * Use to create objects by yourself 462 * Use to create objects by yourself. 463 463 */ 464 464 class MockClass extends stdClass {} 465 465 466 466 /** 467 * Drops all tables from the WordPress database 467 * Drops all tables from the WordPress database. 468 468 */ 469 469 function drop_tables() { -
trunk/tests/phpunit/tests/functions/sizeFormat.php
r52955 r54855 15 15 public function _data_size_format() { 16 16 return array( 17 // Invalid values 17 // Invalid values. 18 18 array( array(), 0, false ), 19 19 array( 'baba', 0, false ), … … 21 21 array( '-1', 0, false ), 22 22 array( -1, 0, false ), 23 // Bytes 23 // Bytes. 24 24 array( 0, 0, '0 B' ), 25 25 array( 1, 0, '1 B' ), 26 26 array( 1023, 0, '1,023 B' ), 27 // Kilobytes 27 // Kilobytes. 28 28 array( KB_IN_BYTES, 0, '1 KB' ), 29 29 array( KB_IN_BYTES, 2, '1.00 KB' ), … … 31 31 array( 2.5 * KB_IN_BYTES, 2, '2.50 KB' ), 32 32 array( 10 * KB_IN_BYTES, 0, '10 KB' ), 33 // Megabytes 33 // Megabytes. 34 34 array( (string) 1024 * KB_IN_BYTES, 2, '1.00 MB' ), 35 35 array( MB_IN_BYTES, 0, '1 MB' ), 36 36 array( 2.5 * MB_IN_BYTES, 0, '3 MB' ), 37 37 array( 2.5 * MB_IN_BYTES, 2, '2.50 MB' ), 38 // Gigabytes 38 // Gigabytes. 39 39 array( (string) 1024 * MB_IN_BYTES, 2, '1.00 GB' ), 40 40 array( GB_IN_BYTES, 0, '1 GB' ), 41 41 array( 2.5 * GB_IN_BYTES, 0, '3 GB' ), 42 42 array( 2.5 * GB_IN_BYTES, 2, '2.50 GB' ), 43 // Terabytes 43 // Terabytes. 44 44 array( (string) 1024 * GB_IN_BYTES, 2, '1.00 TB' ), 45 45 array( TB_IN_BYTES, 0, '1 TB' ), 46 46 array( 2.5 * TB_IN_BYTES, 0, '3 TB' ), 47 47 array( 2.5 * TB_IN_BYTES, 2, '2.50 TB' ), 48 // Petabytes 48 // Petabytes. 49 49 array( (string) 1024 * TB_IN_BYTES, 2, '1.00 PB' ), 50 50 array( PB_IN_BYTES, 0, '1 PB' ), 51 51 array( 2.5 * PB_IN_BYTES, 0, '3 PB' ), 52 52 array( 2.5 * PB_IN_BYTES, 2, '2.50 PB' ), 53 // Exabytes 53 // Exabytes. 54 54 array( (string) 1024 * PB_IN_BYTES, 2, '1.00 EB' ), 55 55 array( EB_IN_BYTES, 0, '1 EB' ), 56 56 array( 2.5 * EB_IN_BYTES, 0, '3 EB' ), 57 57 array( 2.5 * EB_IN_BYTES, 2, '2.50 EB' ), 58 // Zettabytes 58 // Zettabytes. 59 59 array( (string) 1024 * EB_IN_BYTES, 2, '1.00 ZB' ), 60 60 array( ZB_IN_BYTES, 0, '1 ZB' ), 61 61 array( 2.5 * ZB_IN_BYTES, 0, '3 ZB' ), 62 62 array( 2.5 * ZB_IN_BYTES, 2, '2.50 ZB' ), 63 // Yottabytes 63 // Yottabytes. 64 64 array( (string) 1024 * ZB_IN_BYTES, 2, '1.00 YB' ), 65 65 array( YB_IN_BYTES, 0, '1 YB' ), 66 66 array( 2.5 * YB_IN_BYTES, 0, '3 YB' ), 67 67 array( 2.5 * YB_IN_BYTES, 2, '2.50 YB' ), 68 // Edge values 68 // Edge values. 69 69 array( TB_IN_BYTES + ( TB_IN_BYTES / 2 ) + MB_IN_BYTES, 1, '1.5 TB' ), 70 70 array( TB_IN_BYTES - MB_IN_BYTES - KB_IN_BYTES, 3, '1,023.999 GB' ), -
trunk/tests/phpunit/tests/functions/wpListSort.php
r51667 r54855 13 13 * 14 14 * @param string|array $orderby Either the field name to order by or an array 15 * of multiple orderby fields as $orderby => $order.15 * of multiple orderby fields as `$orderby => $order`. 16 16 * @param string $order Either 'ASC' or 'DESC'. 17 17 */ … … 338 338 * 339 339 * @param string|array $orderby Either the field name to order by or an array 340 * of multiple orderby fields as $orderby => $order.340 * of multiple orderby fields as `$orderby => $order`. 341 341 * @param string $order Either 'ASC' or 'DESC'. 342 342 */ -
trunk/tests/phpunit/tests/functions/wpListUtil.php
r54663 r54855 65 65 * @param string $target_key The key to pluck. 66 66 * @param array $expected The expected array. 67 * @param string $index_key Optional. Field from the element to use as keys for the new array. Default null. 67 * @param string $index_key Optional. Field from the element to use as keys for the new array. 68 * Default null. 68 69 */ 69 70 public function test_wp_list_util_pluck( $target_array, $target_key, $expected, $index_key = null ) { … … 157 158 * @param array $expected The expected array. 158 159 * @param array $target_array The array to create a list from. 159 * @param array $orderby Optional. Either the field name to order by or an array of multiple orderby fields as $orderby => $order. 160 * @param array $orderby Optional. Either the field name to order by or an array 161 * of multiple orderby fields as `$orderby => $order`. 160 162 * Default empty array. 161 * @param string $order Optional. Either 'ASC' or 'DESC'. Only used if $orderby is a string. Default 'ASC'. 163 * @param string $order Optional. Either 'ASC' or 'DESC'. Only used if `$orderby` 164 * is a string. Default 'ASC'. 162 165 * @param bool $preserve_keys Optional. Whether to preserve keys. Default false. 163 166 */ … … 956 959 * @param array $expected The expected array. 957 960 * @param array $target_array The array to create a list from. 958 * @param array $orderby Optional. Either the field name to order by or an array of multiple orderby fields as $orderby => $order. 961 * @param array $orderby Optional. Either the field name to order by or an array 962 * of multiple orderby fields as `$orderby => $order`. 959 963 * Default empty array. 960 * @param string $order Optional. Either 'ASC' or 'DESC'. Only used if $orderby is a string. Default 'ASC'. 964 * @param string $order Optional. Either 'ASC' or 'DESC'. Only used if `$orderby` 965 * is a string. Default 'ASC'. 961 966 * @param bool $preserve_keys Optional. Whether to preserve keys. Default false. 962 967 */ -
trunk/tests/phpunit/tests/functions/wpNonceField.php
r54420 r54855 15 15 */ 16 16 public function test_wp_nonce_field() { 17 18 17 wp_nonce_field(); 19 18 $this->expectOutputRegex( '#^<input type="hidden" id="_wpnonce" name="_wpnonce" value=".{10}" /><input type="hidden" name="_wp_http_referer" value="" />$#' ); … … 25 24 * @dataProvider data_wp_nonce_field 26 25 * 27 * @param int|string $action Action name.28 * @param string $name Nonce name.29 * @param bool $referer Whether to set the referer field fior validation.30 * @param string $expected_reg _exp The expected regular expression.26 * @param int|string $action Action name. 27 * @param string $name Nonce name. 28 * @param bool $referer Whether to set the referer field for validation. 29 * @param string $expected_regexp The expected regular expression. 31 30 */ 32 public function test_wp_nonce_field_return( $action, $name, $referer, $expected_reg_exp ) { 33 34 $this->assertMatchesRegularExpression( $expected_reg_exp, wp_nonce_field( $action, $name, $referer, false ) ); 31 public function test_wp_nonce_field_return( $action, $name, $referer, $expected_regexp ) { 32 $this->assertMatchesRegularExpression( $expected_regexp, wp_nonce_field( $action, $name, $referer, false ) ); 35 33 } 36 34 … … 41 39 */ 42 40 public function data_wp_nonce_field() { 43 44 41 return array( 45 42 'default' => array( 46 'action' => -1,47 'name' 48 'referer' 49 'expected_reg _exp' => '#^<input type="hidden" id="_wpnonce" name="_wpnonce" value=".{10}" /><input type="hidden" name="_wp_http_referer" value="" />$#',43 'action' => -1, 44 'name' => '_wpnonce', 45 'referer' => true, 46 'expected_regexp' => '#^<input type="hidden" id="_wpnonce" name="_wpnonce" value=".{10}" /><input type="hidden" name="_wp_http_referer" value="" />$#', 50 47 ), 51 48 'nonce_name' => array( 52 'action' => -1,53 'name' 54 'referer' 55 'expected_reg _exp' => '#^<input type="hidden" id="nonce_name" name="nonce_name" value=".{10}" /><input type="hidden" name="_wp_http_referer" value="" />$#',49 'action' => -1, 50 'name' => 'nonce_name', 51 'referer' => true, 52 'expected_regexp' => '#^<input type="hidden" id="nonce_name" name="nonce_name" value=".{10}" /><input type="hidden" name="_wp_http_referer" value="" />$#', 56 53 ), 57 54 'action_name' => array( 58 'action' 59 'name' 60 'referer' 61 'expected_reg _exp' => '#^<input type="hidden" id="_wpnonce" name="_wpnonce" value="' . wp_create_nonce( 'action_name' ) . '" /><input type="hidden" name="_wp_http_referer" value="" />$#',55 'action' => 'action_name', 56 'name' => '_wpnonce', 57 'referer' => true, 58 'expected_regexp' => '#^<input type="hidden" id="_wpnonce" name="_wpnonce" value="' . wp_create_nonce( 'action_name' ) . '" /><input type="hidden" name="_wp_http_referer" value="" />$#', 62 59 ), 63 60 'no_referer' => array( 64 'action' => -1,65 'name' 66 'referer' 67 'expected_reg _exp' => '#^<input type="hidden" id="_wpnonce" name="_wpnonce" value=".{10}" />$#',61 'action' => -1, 62 'name' => '_wpnonce', 63 'referer' => false, 64 'expected_regexp' => '#^<input type="hidden" id="_wpnonce" name="_wpnonce" value=".{10}" />$#', 68 65 ), 69 66 '& in name' => array( 70 'action' => -1,71 'name' 72 'referer' 73 'expected_reg _exp' => '#^<input type="hidden" id="a\&b" name="a\&b" value=".{10}" />$#',67 'action' => -1, 68 'name' => 'a&b', 69 'referer' => false, 70 'expected_regexp' => '#^<input type="hidden" id="a\&b" name="a\&b" value=".{10}" />$#', 74 71 ), 75 72 ); -
trunk/tests/phpunit/tests/functions/wpRefererField.php
r54449 r54855 15 15 */ 16 16 public function test_wp_referer_field() { 17 $_SERVER['REQUEST_URI'] = '/test/'; 17 18 18 $_SERVER['REQUEST_URI'] = '/test/';19 19 wp_referer_field(); 20 20 $this->expectOutputString( '<input type="hidden" name="_wp_http_referer" value="/test/" />' ); … … 25 25 */ 26 26 public function test_wp_referer_field_return() { 27 28 27 $_SERVER['REQUEST_URI'] = '/test/'; 29 28 -
trunk/tests/phpunit/tests/rest-api/rest-posts-controller.php
r54396 r54855 1530 1530 /** 1531 1531 * @ticket 55592 1532 * 1532 1533 * @covers WP_REST_Posts_Controller::get_items 1533 1534 * @covers ::update_post_thumbnail_cache … … 1567 1568 /** 1568 1569 * @ticket 55593 1570 * 1569 1571 * @covers WP_REST_Posts_Controller::get_items 1570 1572 * @covers ::update_post_parent_caches -
trunk/tests/phpunit/tests/theme/wpThemeJson.php
r54821 r54855 3027 3027 3028 3028 /** 3029 * Testing that dynamic properties in theme.json return the value they ref rence,3029 * Testing that dynamic properties in theme.json return the value they reference, 3030 3030 * e.g. array( 'ref' => 'styles.color.background' ) => "#ffffff". 3031 3031 *
Note: See TracChangeset
for help on using the changeset viewer.