Skip to content

Commit 9c4ddc2

Browse files
committed
Docs: Miscellaneous improvements and corrections to docblocks.
See #56792 git-svn-id: https://develop.svn.wordpress.org/trunk@55293 602fd350-edb4-49c9-b593-d223f7449a82
1 parent d2d0f66 commit 9c4ddc2

File tree

7 files changed

+33
-20
lines changed

7 files changed

+33
-20
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -387,7 +387,7 @@ public function search_box( $text, $input_id ) {
387387
* @type string $label The link label.
388388
* @type bool $current Optional. Whether this is the currently selected view.
389389
* }
390-
* @return array An array of link markup. Keys match the `$link_data` input array.
390+
* @return string[] An array of link markup. Keys match the `$link_data` input array.
391391
*/
392392
protected function get_views_links( $link_data = array() ) {
393393
if ( ! is_array( $link_data ) ) {

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ final class WP_Screen {
144144
* The accessible hidden headings and text associated with the screen, if any.
145145
*
146146
* @since 4.4.0
147-
* @var array
147+
* @var string[]
148148
*/
149149
private $_screen_reader_content = array();
150150

@@ -721,7 +721,7 @@ public function get_columns() {
721721
*
722722
* @see set_screen_reader_content() For more information on the array format.
723723
*
724-
* @return array An associative array of screen reader text strings.
724+
* @return string[] An associative array of screen reader text strings.
725725
*/
726726
public function get_screen_reader_content() {
727727
return $this->_screen_reader_content;

src/wp-admin/includes/nav-menu.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1152,13 +1152,13 @@ function _wp_delete_orphaned_draft_menu_items() {
11521152
}
11531153

11541154
/**
1155-
* Saves nav menu items
1155+
* Saves nav menu items.
11561156
*
11571157
* @since 3.6.0
11581158
*
11591159
* @param int|string $nav_menu_selected_id ID, slug, or name of the currently-selected menu.
11601160
* @param string $nav_menu_selected_title Title of the currently-selected menu.
1161-
* @return array The menu updated message
1161+
* @return string[] The menu updated messages.
11621162
*/
11631163
function wp_nav_menu_update_menu_items( $nav_menu_selected_id, $nav_menu_selected_title ) {
11641164
$unsorted_menu_items = wp_get_nav_menu_items(

src/wp-includes/cron.php

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -77,14 +77,14 @@ function wp_schedule_single_event( $timestamp, $hook, $args = array(), $wp_error
7777
* @since 5.7.0 The `$wp_error` parameter was added, and a `WP_Error` object can now be returned.
7878
*
7979
* @param null|bool|WP_Error $result The value to return instead. Default null to continue adding the event.
80-
* @param stdClass $event {
80+
* @param object $event {
8181
* An object containing an event's data.
8282
*
8383
* @type string $hook Action hook to execute when the event is run.
8484
* @type int $timestamp Unix timestamp (UTC) for when to next run the event.
8585
* @type string|false $schedule How often the event should subsequently recur.
8686
* @type array $args Array containing each separate argument to pass to the hook's callback function.
87-
* @type int $interval The interval time in seconds for the schedule. Only present for recurring events.
87+
* @type int $interval Optional. The interval time in seconds for the schedule. Only present for recurring events.
8888
* }
8989
* @param bool $wp_error Whether to return a WP_Error on failure.
9090
*/
@@ -164,14 +164,14 @@ function wp_schedule_single_event( $timestamp, $hook, $args = array(), $wp_error
164164
*
165165
* @since 3.1.0
166166
*
167-
* @param stdClass|false $event {
167+
* @param object|false $event {
168168
* An object containing an event's data, or boolean false to prevent the event from being scheduled.
169169
*
170170
* @type string $hook Action hook to execute when the event is run.
171171
* @type int $timestamp Unix timestamp (UTC) for when to next run the event.
172172
* @type string|false $schedule How often the event should subsequently recur.
173173
* @type array $args Array containing each separate argument to pass to the hook's callback function.
174-
* @type int $interval The interval time in seconds for the schedule. Only present for recurring events.
174+
* @type int $interval Optional. The interval time in seconds for the schedule. Only present for recurring events.
175175
* }
176176
*/
177177
$event = apply_filters( 'schedule_event', $event );
@@ -385,7 +385,7 @@ function wp_reschedule_event( $timestamp, $recurrence, $hook, $args = array(), $
385385
* @since 5.7.0 The `$wp_error` parameter was added, and a `WP_Error` object can now be returned.
386386
*
387387
* @param null|bool|WP_Error $pre Value to return instead. Default null to continue adding the event.
388-
* @param stdClass $event {
388+
* @param object $event {
389389
* An object containing an event's data.
390390
*
391391
* @type string $hook Action hook to execute when the event is run.
@@ -722,7 +722,15 @@ function wp_unschedule_hook( $hook, $wp_error = false ) {
722722
* Default empty array.
723723
* @param int|null $timestamp Optional. Unix timestamp (UTC) of the event. If not specified, the next scheduled event
724724
* is returned. Default null.
725-
* @return object|false The event object. False if the event does not exist.
725+
* @return object|false {
726+
* The event object. False if the event does not exist.
727+
*
728+
* @type string $hook Action hook to execute when the event is run.
729+
* @type int $timestamp Unix timestamp (UTC) for when to next run the event.
730+
* @type string|false $schedule How often the event should subsequently recur.
731+
* @type array $args Array containing each separate argument to pass to the hook's callback function.
732+
* @type int $interval Optional. The interval time in seconds for the schedule. Only present for recurring events.
733+
* }
726734
*/
727735
function wp_get_scheduled_event( $hook, $args = array(), $timestamp = null ) {
728736
/**

src/wp-includes/rest-api.php

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1292,8 +1292,13 @@ function rest_parse_hex_color( $color ) {
12921292
*
12931293
* @param string $date RFC3339 timestamp.
12941294
* @param bool $is_utc Whether the provided date should be interpreted as UTC. Default false.
1295-
* @return array|null Local and UTC datetime strings, in MySQL datetime format (Y-m-d H:i:s),
1296-
* null on failure.
1295+
* @return array|null {
1296+
* Local and UTC datetime strings, in MySQL datetime format (Y-m-d H:i:s),
1297+
* null on failure.
1298+
*
1299+
* @type string $0 Local datetime string.
1300+
* @type string $1 UTC datetime string.
1301+
* }
12971302
*/
12981303
function rest_get_date_with_gmt( $date, $is_utc = false ) {
12991304
/*
@@ -1549,12 +1554,12 @@ function rest_is_object( $maybe_object ) {
15491554
}
15501555

15511556
/**
1552-
* Converts an object-like value to an object.
1557+
* Converts an object-like value to an array.
15531558
*
15541559
* @since 5.5.0
15551560
*
15561561
* @param mixed $maybe_object The value being evaluated.
1557-
* @return array Returns the object extracted from the value.
1562+
* @return array Returns the object extracted from the value as an associative array.
15581563
*/
15591564
function rest_sanitize_object( $maybe_object ) {
15601565
if ( '' === $maybe_object ) {
@@ -1581,8 +1586,8 @@ function rest_sanitize_object( $maybe_object ) {
15811586
*
15821587
* @since 5.5.0
15831588
*
1584-
* @param mixed $value The value to check.
1585-
* @param array $types The list of possible types.
1589+
* @param mixed $value The value to check.
1590+
* @param string[] $types The list of possible types.
15861591
* @return string The best matching type, an empty string if no types match.
15871592
*/
15881593
function rest_get_best_type_for_value( $value, $types ) {

src/wp-includes/rest-api/endpoints/class-wp-rest-search-controller.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,7 @@ public function get_collection_params() {
360360
* @param string|array $subtypes One or more subtypes.
361361
* @param WP_REST_Request $request Full details about the request.
362362
* @param string $parameter Parameter name.
363-
* @return array|WP_Error List of valid subtypes, or WP_Error object on failure.
363+
* @return string[]|WP_Error List of valid subtypes, or WP_Error object on failure.
364364
*/
365365
public function sanitize_subtypes( $subtypes, $request, $parameter ) {
366366
$subtypes = wp_parse_slug_list( $subtypes );

src/wp-includes/rest-api/search/class-wp-rest-search-handler.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ abstract class WP_REST_Search_Handler {
3737
* Object subtypes managed by this search handler.
3838
*
3939
* @since 5.0.0
40-
* @var array
40+
* @var string[]
4141
*/
4242
protected $subtypes = array();
4343

@@ -57,7 +57,7 @@ public function get_type() {
5757
*
5858
* @since 5.0.0
5959
*
60-
* @return array Array of object subtype identifiers.
60+
* @return string[] Array of object subtype identifiers.
6161
*/
6262
public function get_subtypes() {
6363
return $this->subtypes;

0 commit comments

Comments
 (0)