Skip to content

Commit c17f579

Browse files
committed
Merge branch 'trunk' into 64418/customizer-allow-arbitrary-custom-css
2 parents 848c53b + 14feeb5 commit c17f579

20 files changed

+486
-347
lines changed

src/wp-admin/includes/ajax-actions.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -455,7 +455,7 @@ function wp_ajax_logged_in() {
455455
* @access private
456456
*
457457
* @param int $comment_id Comment ID.
458-
* @param int $delta Change in the number of total comments. Default -1.
458+
* @param int $delta Optional. Change in the number of total comments. Default -1.
459459
*/
460460
function _wp_ajax_delete_comment_response( $comment_id, $delta = -1 ) {
461461
$total = isset( $_POST['_total'] ) ? (int) $_POST['_total'] : 0;

src/wp-admin/includes/class-wp-comments-list-table.php

Lines changed: 52 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -70,18 +70,22 @@ public function floated_admin_avatar( $name, $comment_id ) {
7070
}
7171

7272
/**
73-
* @return bool
73+
* Checks if the user can edit posts.
74+
*
75+
* @return bool Whether the user can edit posts.
7476
*/
7577
public function ajax_user_can() {
7678
return current_user_can( 'edit_posts' );
7779
}
7880

7981
/**
80-
* @global string $mode List table view mode.
81-
* @global int $post_id
82-
* @global string $comment_status
83-
* @global string $comment_type
84-
* @global string $search
82+
* Prepares the comments list items.
83+
*
84+
* @global string $mode Current list table display mode.
85+
* @global int $post_id Current post ID filter.
86+
* @global string $comment_status Comment status filter.
87+
* @global string $comment_type Comment type filter.
88+
* @global string $search Search term.
8589
*/
8690
public function prepare_items() {
8791
global $mode, $post_id, $comment_status, $comment_type, $search;
@@ -151,6 +155,7 @@ public function prepare_items() {
151155
'number' => $number,
152156
'post_id' => $post_id,
153157
'type' => $comment_type,
158+
'type__not_in' => array( 'note' ),
154159
'orderby' => $orderby,
155160
'order' => $order,
156161
'post_type' => $post_type,
@@ -198,8 +203,10 @@ public function prepare_items() {
198203
}
199204

200205
/**
201-
* @param string $comment_status
202-
* @return int
206+
* Gets the number of comments to display per page.
207+
*
208+
* @param string $comment_status Comment status.
209+
* @return int Comments per page.
203210
*/
204211
public function get_per_page( $comment_status = 'all' ) {
205212
$comments_per_page = $this->get_items_per_page( 'edit_comments_per_page' );
@@ -216,6 +223,8 @@ public function get_per_page( $comment_status = 'all' ) {
216223
}
217224

218225
/**
226+
* Displays a message when no comments are found.
227+
*
219228
* @global string $comment_status
220229
*/
221230
public function no_items() {
@@ -231,9 +240,13 @@ public function no_items() {
231240
}
232241

233242
/**
234-
* @global int $post_id
243+
* Returns an array of comment status links.
244+
*
245+
* @global int $post_id
235246
* @global string $comment_status
236247
* @global string $comment_type
248+
*
249+
* @return array<string, string> Comment status HTML links keyed by view.
237250
*/
238251
protected function get_views() {
239252
global $post_id, $comment_status, $comment_type;
@@ -354,9 +367,11 @@ protected function get_views() {
354367
}
355368

356369
/**
357-
* @global string $comment_status
370+
* Gets the available bulk actions for the comments list.
371+
*
372+
* @global string $comment_status Current comment status filter.
358373
*
359-
* @return array
374+
* @return array<string, string> Bulk action labels keyed by action name.
360375
*/
361376
protected function get_bulk_actions() {
362377
global $comment_status;
@@ -395,10 +410,12 @@ protected function get_bulk_actions() {
395410
}
396411

397412
/**
413+
* Displays extra controls between bulk actions and pagination.
414+
*
398415
* @global string $comment_status
399416
* @global string $comment_type
400417
*
401-
* @param string $which
418+
* @param string $which The location of the extra table nav markup: Either 'top' or 'bottom'.
402419
*/
403420
protected function extra_tablenav( $which ) {
404421
global $comment_status, $comment_type;
@@ -453,7 +470,9 @@ protected function extra_tablenav( $which ) {
453470
}
454471

455472
/**
456-
* @return string|false
473+
* Gets the current action selected from the bulk actions dropdown.
474+
*
475+
* @return string|false Current action or false if none.
457476
*/
458477
public function current_action() {
459478
if ( isset( $_REQUEST['delete_all'] ) || isset( $_REQUEST['delete_all2'] ) ) {
@@ -464,6 +483,8 @@ public function current_action() {
464483
}
465484

466485
/**
486+
* Gets the list of columns.
487+
*
467488
* @global int $post_id
468489
*
469490
* @return string[] Array of column titles keyed by their column name.
@@ -547,7 +568,9 @@ protected function comment_type_dropdown( $comment_type ) {
547568
}
548569

549570
/**
550-
* @return array
571+
* Gets a list of sortable columns.
572+
*
573+
* @return array<string, string|array> The sortable columns.
551574
*/
552575
protected function get_sortable_columns() {
553576
return array(
@@ -638,10 +661,12 @@ public function display() {
638661
}
639662

640663
/**
664+
* Generates content for a single row of the table.
665+
*
641666
* @global WP_Post $post Global post object.
642667
* @global WP_Comment $comment Global comment object.
643668
*
644-
* @param WP_Comment $item
669+
* @param WP_Comment $item The comment object.
645670
*/
646671
public function single_row( $item ) {
647672
global $post, $comment;
@@ -917,6 +942,8 @@ protected function handle_row_actions( $item, $column_name, $primary ) {
917942
}
918943

919944
/**
945+
* Outputs the checkbox column.
946+
*
920947
* @since 5.9.0 Renamed `$comment` to `$item` to match parent class for PHP 8 named parameter support.
921948
*
922949
* @param WP_Comment $item The comment object.
@@ -941,6 +968,8 @@ public function column_cb( $item ) {
941968
}
942969

943970
/**
971+
* Outputs the comment column.
972+
*
944973
* @param WP_Comment $comment The comment object.
945974
*/
946975
public function column_comment( $comment ) {
@@ -980,6 +1009,8 @@ public function column_comment( $comment ) {
9801009
}
9811010

9821011
/**
1012+
* Outputs the author column.
1013+
*
9831014
* @global string $comment_status
9841015
*
9851016
* @param WP_Comment $comment The comment object.
@@ -1039,6 +1070,8 @@ public function column_author( $comment ) {
10391070
}
10401071

10411072
/**
1073+
* Outputs the date column.
1074+
*
10421075
* @param WP_Comment $comment The comment object.
10431076
*/
10441077
public function column_date( $comment ) {
@@ -1067,6 +1100,8 @@ public function column_date( $comment ) {
10671100
}
10681101

10691102
/**
1103+
* Outputs the response column.
1104+
*
10701105
* @param WP_Comment $comment The comment object.
10711106
*/
10721107
public function column_response( $comment ) {
@@ -1113,6 +1148,8 @@ public function column_response( $comment ) {
11131148
}
11141149

11151150
/**
1151+
* Outputs the default column.
1152+
*
11161153
* @since 5.9.0 Renamed `$comment` to `$item` to match parent class for PHP 8 named parameter support.
11171154
*
11181155
* @param WP_Comment $item The comment object.

src/wp-admin/includes/class-wp-importer.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
11
<?php
22
/**
33
* WP_Importer base class
4+
*
5+
* @package WordPress
6+
* @subpackage Importer
7+
* @since 3.0.0
48
*/
9+
510
#[AllowDynamicProperties]
611
class WP_Importer {
712
/**

src/wp-admin/includes/class-wp-list-table.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,14 +80,14 @@ class WP_List_Table {
8080
protected $_column_headers;
8181

8282
/**
83-
* {@internal Missing Summary}
83+
* List of private properties made readable for backward compatibility.
8484
*
8585
* @var array
8686
*/
8787
protected $compat_fields = array( '_args', '_pagination_args', 'screen', '_actions', '_pagination' );
8888

8989
/**
90-
* {@internal Missing Summary}
90+
* List of private/protected methods made readable for backward compatibility.
9191
*
9292
* @var array
9393
*/
@@ -280,7 +280,7 @@ public function __call( $name, $arguments ) {
280280
}
281281

282282
/**
283-
* Checks the current user's permissions
283+
* Checks the current user's permissions.
284284
*
285285
* @since 3.1.0
286286
* @abstract

src/wp-admin/nav-menus.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -672,12 +672,14 @@
672672
}
673673

674674
/**
675+
* Adds a CSS class to display the max depth of the navigation menu.
676+
*
675677
* @since 3.0.0
676678
*
677-
* @global int $_wp_nav_menu_max_depth
679+
* @global int $_wp_nav_menu_max_depth Maximum depth of the navigation menu.
678680
*
679-
* @param string $classes
680-
* @return string
681+
* @param string $classes Existing CSS classes for the body tag.
682+
* @return string Modified CSS classes including the menu max depth class.
681683
*/
682684
function wp_nav_menu_max_depth( $classes ) {
683685
global $_wp_nav_menu_max_depth;

src/wp-admin/update-core.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -840,7 +840,7 @@ function list_translation_updates() {
840840
*
841841
* @global WP_Filesystem_Base $wp_filesystem WordPress filesystem subclass.
842842
*
843-
* @param bool $reinstall
843+
* @param bool $reinstall Optional. Whether to reinstall WordPress. Default false.
844844
*/
845845
function do_core_upgrade( $reinstall = false ) {
846846
global $wp_filesystem;

src/wp-includes/deprecated.php

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6479,3 +6479,33 @@ function wp_print_auto_sizes_contain_css_fix() {
64796479
<style>img:is([sizes="auto" i], [sizes^="auto," i]) { contain-intrinsic-size: 3000px 1500px }</style>
64806480
<?php
64816481
}
6482+
6483+
/**
6484+
* Sanitizes an attributes array into an attributes string to be placed inside a `<script>` tag.
6485+
*
6486+
* This function is deprecated, use {@see wp_get_script_tag()} or {@see wp_get_inline_script_tag()} instead.
6487+
*
6488+
* @since 5.7.0
6489+
* @deprecated 7.0.0 Use wp_get_script_tag() or wp_get_inline_script_tag().
6490+
* @see wp_get_script_tag()
6491+
* @see wp_get_inline_script_tag()
6492+
*
6493+
* @param array<string, string|bool> $attributes Key-value pairs representing `<script>` tag attributes.
6494+
* @return string String made of sanitized `<script>` tag attributes.
6495+
*/
6496+
function wp_sanitize_script_attributes( $attributes ) {
6497+
_deprecated_function( __FUNCTION__, '7.0.0', 'wp_get_script_tag() or wp_get_inline_script_tag()' );
6498+
6499+
$attributes_string = '';
6500+
foreach ( $attributes as $attribute_name => $attribute_value ) {
6501+
if ( is_bool( $attribute_value ) ) {
6502+
if ( $attribute_value ) {
6503+
$attributes_string .= ' ' . esc_attr( $attribute_name );
6504+
}
6505+
} else {
6506+
$attributes_string .= sprintf( ' %1$s="%2$s"', esc_attr( $attribute_name ), esc_attr( $attribute_value ) );
6507+
}
6508+
}
6509+
return $attributes_string;
6510+
}
6511+

src/wp-includes/script-loader.php

Lines changed: 8 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1630,7 +1630,7 @@ function wp_default_styles( $styles ) {
16301630
$styles->add( 'code-editor', "/wp-admin/css/code-editor$suffix.css", array( 'wp-codemirror' ) );
16311631
$styles->add( 'site-health', "/wp-admin/css/site-health$suffix.css" );
16321632

1633-
$styles->add( 'wp-admin', false, array( 'dashicons', 'common', 'forms', 'admin-menu', 'dashboard', 'list-tables', 'edit', 'revisions', 'media', 'themes', 'about', 'nav-menus', 'widgets', 'site-icon', 'l10n' ) );
1633+
$styles->add( 'wp-admin', false, array( 'dashicons', 'common', 'forms', 'admin-menu', 'dashboard', 'list-tables', 'edit', 'revisions', 'media', 'themes', 'about', 'nav-menus', 'widgets', 'site-icon', 'l10n', 'wp-base-styles' ) );
16341634

16351635
$styles->add( 'login', "/wp-admin/css/login$suffix.css", array( 'dashicons', 'buttons', 'forms', 'l10n' ) );
16361636
$styles->add( 'install', "/wp-admin/css/install$suffix.css", array( 'dashicons', 'buttons', 'forms', 'l10n' ) );
@@ -1713,6 +1713,7 @@ function wp_default_styles( $styles ) {
17131713

17141714
// Only add CONTENT styles here that should be enqueued in the iframe!
17151715
$wp_edit_blocks_dependencies = array(
1716+
'wp-base-styles',
17161717
'wp-components',
17171718
/*
17181719
* This needs to be added before the block library styles,
@@ -1752,6 +1753,7 @@ function wp_default_styles( $styles ) {
17521753
'block-editor' => array( 'wp-components', 'wp-preferences' ),
17531754
'block-library' => array(),
17541755
'block-directory' => array(),
1756+
'base-styles' => array(),
17551757
'components' => array(),
17561758
'commands' => array( 'wp-components' ),
17571759
'edit-post' => array(
@@ -1814,6 +1816,11 @@ function wp_default_styles( $styles ) {
18141816
if ( 'block-library' === $package && wp_should_load_separate_core_block_assets() ) {
18151817
$path = "/wp-includes/css/dist/$package/common$suffix.css";
18161818
}
1819+
1820+
if ( 'base-styles' === $package ) {
1821+
$path = "/wp-includes/css/dist/base-styles/admin-schemes$suffix.css";
1822+
}
1823+
18171824
$styles->add( $handle, $path, $dependencies );
18181825
$styles->add_data( $handle, 'path', ABSPATH . $path );
18191826
}
@@ -2875,37 +2882,6 @@ function wp_enqueue_editor_format_library_assets() {
28752882
wp_enqueue_style( 'wp-format-library' );
28762883
}
28772884

2878-
/**
2879-
* Sanitizes an attributes array into an attributes string to be placed inside a `<script>` tag.
2880-
*
2881-
* Automatically injects type attribute if needed.
2882-
* Used by {@see wp_get_script_tag()} and {@see wp_get_inline_script_tag()}.
2883-
*
2884-
* @since 5.7.0
2885-
*
2886-
* @param array<string, string|bool> $attributes Key-value pairs representing `<script>` tag attributes.
2887-
* @return string String made of sanitized `<script>` tag attributes.
2888-
*/
2889-
function wp_sanitize_script_attributes( $attributes ) {
2890-
$attributes_string = '';
2891-
2892-
/*
2893-
* If HTML5 script tag is supported, only the attribute name is added
2894-
* to $attributes_string for entries with a boolean value, and that are true.
2895-
*/
2896-
foreach ( $attributes as $attribute_name => $attribute_value ) {
2897-
if ( is_bool( $attribute_value ) ) {
2898-
if ( $attribute_value ) {
2899-
$attributes_string .= ' ' . esc_attr( $attribute_name );
2900-
}
2901-
} else {
2902-
$attributes_string .= sprintf( ' %1$s="%2$s"', esc_attr( $attribute_name ), esc_attr( $attribute_value ) );
2903-
}
2904-
}
2905-
2906-
return $attributes_string;
2907-
}
2908-
29092885
/**
29102886
* Formats `<script>` loader tags.
29112887
*

0 commit comments

Comments
 (0)