From d09d194f122a972bad9a5dd29f2e5411b3434b0d Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Mon, 13 Dec 2021 10:21:07 +0000 Subject: [PATCH] Docs: Capitalize "ID", when referring to a widget ID or sidebar ID, in a more consistent way. Follow-up to [48104], [52357], [52361]. See #53399. Built from https://develop.svn.wordpress.org/trunk@52362 git-svn-id: http://core.svn.wordpress.org/trunk@51954 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/widgets.php | 2 +- .../endpoints/class-wp-rest-sidebars-controller.php | 4 ++-- .../endpoints/class-wp-rest-widgets-controller.php | 2 +- wp-includes/version.php | 2 +- wp-includes/widgets.php | 12 ++++++------ 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/wp-admin/includes/widgets.php b/wp-admin/includes/widgets.php index af33787fa6..a5d65a7513 100644 --- a/wp-admin/includes/widgets.php +++ b/wp-admin/includes/widgets.php @@ -226,7 +226,7 @@ function wp_widget_control( $sidebar_args ) { if ( isset( $sidebar_args['_display'] ) && 'template' === $sidebar_args['_display'] && $widget_number ) { // number == -1 implies a template where id numbers are replaced by a generic '__i__'. $control['params'][0]['number'] = -1; - // With id_base widget id's are constructed like {$id_base}-{$id_number}. + // With id_base widget ID's are constructed like {$id_base}-{$id_number}. if ( isset( $control['id_base'] ) ) { $id_format = $control['id_base'] . '-__i__'; } diff --git a/wp-includes/rest-api/endpoints/class-wp-rest-sidebars-controller.php b/wp-includes/rest-api/endpoints/class-wp-rest-sidebars-controller.php index fbc70fe331..3ce3beded2 100644 --- a/wp-includes/rest-api/endpoints/class-wp-rest-sidebars-controller.php +++ b/wp-includes/rest-api/endpoints/class-wp-rest-sidebars-controller.php @@ -219,12 +219,12 @@ class WP_REST_Sidebars_Controller extends WP_REST_Controller { foreach ( $sidebars as $sidebar_id => $widgets ) { foreach ( $widgets as $i => $widget_id ) { - // This automatically removes the passed widget ids from any other sidebars in use. + // This automatically removes the passed widget IDs from any other sidebars in use. if ( $sidebar_id !== $request['id'] && in_array( $widget_id, $request['widgets'], true ) ) { unset( $sidebars[ $sidebar_id ][ $i ] ); } - // This automatically removes omitted widget ids to the inactive sidebar. + // This automatically removes omitted widget IDs to the inactive sidebar. if ( $sidebar_id === $request['id'] && ! in_array( $widget_id, $request['widgets'], true ) ) { $sidebars['wp_inactive_widgets'][] = $widget_id; } diff --git a/wp-includes/rest-api/endpoints/class-wp-rest-widgets-controller.php b/wp-includes/rest-api/endpoints/class-wp-rest-widgets-controller.php index 692b76261c..079f18cc1f 100644 --- a/wp-includes/rest-api/endpoints/class-wp-rest-widgets-controller.php +++ b/wp-includes/rest-api/endpoints/class-wp-rest-widgets-controller.php @@ -188,7 +188,7 @@ class WP_REST_Widgets_Controller extends WP_REST_Controller { * * @since 5.9.0 * - * @param string $sidebar_id The sidebar id. + * @param string $sidebar_id The sidebar ID. * @return bool Whether the sidebar can be read. */ protected function check_read_sidebar_permission( $sidebar_id ) { diff --git a/wp-includes/version.php b/wp-includes/version.php index 0d9b019031..c3d7d22f45 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '5.9-beta2-52361'; +$wp_version = '5.9-beta2-52362'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. diff --git a/wp-includes/widgets.php b/wp-includes/widgets.php index c29ddbf523..4aaa6112b2 100644 --- a/wp-includes/widgets.php +++ b/wp-includes/widgets.php @@ -519,7 +519,7 @@ function wp_unregister_sidebar_widget( $id ) { * @type int $width Width of the fully expanded control form (but try hard to use the default width). * Default 250. * @type int|string $id_base Required for multi-widgets, i.e widgets that allow multiple instances such as the - * text widget. The widget id will end up looking like `{$id_base}-{$unique_number}`. + * text widget. The widget ID will end up looking like `{$id_base}-{$unique_number}`. * } * @param mixed ...$params Optional additional parameters to pass to the callback function when it's called. */ @@ -1916,8 +1916,8 @@ function wp_parse_widget_id( $id ) { * * @since 5.8.0 * - * @param string $widget_id The widget id to look for. - * @return string|null The found sidebar's id, or null if it was not found. + * @param string $widget_id The widget ID to look for. + * @return string|null The found sidebar's ID, or null if it was not found. */ function wp_find_widgets_sidebar( $widget_id ) { foreach ( wp_get_sidebars_widgets() as $sidebar_id => $widget_ids ) { @@ -1936,8 +1936,8 @@ function wp_find_widgets_sidebar( $widget_id ) { * * @since 5.8.0 * - * @param string $widget_id The widget id to assign. - * @param string $sidebar_id The sidebar id to assign to. If empty, the widget won't be added to any sidebar. + * @param string $widget_id The widget ID to assign. + * @param string $sidebar_id The sidebar ID to assign to. If empty, the widget won't be added to any sidebar. */ function wp_assign_widget_to_sidebar( $widget_id, $sidebar_id ) { $sidebars = wp_get_sidebars_widgets(); @@ -1946,7 +1946,7 @@ function wp_assign_widget_to_sidebar( $widget_id, $sidebar_id ) { foreach ( $widgets as $i => $maybe_widget_id ) { if ( $widget_id === $maybe_widget_id && $sidebar_id !== $maybe_sidebar_id ) { unset( $sidebars[ $maybe_sidebar_id ][ $i ] ); - // We could technically break 2 here, but continue looping in case the id is duplicated. + // We could technically break 2 here, but continue looping in case the ID is duplicated. continue 2; } }