Make WordPress Core

Changeset 52251


Ignore:
Timestamp:
11/26/2021 12:26:17 AM (2 years ago)
Author:
SergeyBiryukov
Message:

Docs: Improve consistency of some DocBlocks in wp-admin/includes/post.php.

Follow-up to [52249].

See #53399.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/post.php

    r52249 r52251  
    88
    99/**
    10  * Renames $_POST data from form names to DB post columns.
    11  *
    12  * Manipulates $_POST directly.
     10 * Renames `$_POST` data from form names to DB post columns.
     11 *
     12 * Manipulates `$_POST` directly.
    1313 *
    1414 * @since 2.6.0
    1515 *
    16  * @param bool  $update    Whether the post already exists.
    17  * @param array $post_data Array of post data. Defaults to the contents of $_POST.
     16 * @param bool       $update    Whether the post already exists.
     17 * @param array|null $post_data Optional. The array of post data to process.
     18 *                              Defaults to the `$_POST` superglobal.
    1819 * @return array|WP_Error Array of post data on success, WP_Error on failure.
    1920 */
     
    209210 * @since 5.0.1
    210211 *
    211  * @param array $post_data Array of post data. Defaults to the contents of $_POST.
     212 * @param array|null $post_data Optional. The array of post data to process.
     213 *                              Defaults to the `$_POST` superglobal.
    212214 * @return array|WP_Error Array of post data on success, WP_Error on failure.
    213215 */
     
    226228
    227229/**
    228  * Updates an existing post with values provided in $_POST.
     230 * Updates an existing post with values provided in `$_POST`.
    229231 *
    230232 * If post data is passed as an argument, it is treated as an array of data
    231233 * keyed appropriately for turning into a post object.
    232234 *
    233  * If post data is not passed, the $_POST global variable is used instead.
     235 * If post data is not passed, the `$_POST` global variable is used instead.
    234236 *
    235237 * @since 1.5.0
     
    237239 * @global wpdb $wpdb WordPress database abstraction object.
    238240 *
    239  * @param array $post_data Optional. Defaults to the $_POST global.
     241 * @param array|null $post_data Optional. The array of post data to process.
     242 *                              Defaults to the `$_POST` superglobal.
    240243 * @return int Post ID.
    241244 */
     
    462465 * @global wpdb $wpdb WordPress database abstraction object.
    463466 *
    464  * @param array $post_data Optional. The array of post data to process if not provided will use $_POST superglobal.
     467 * @param array|null $post_data Optional. The array of post data to process.
     468 *                              Defaults to the `$_POST` superglobal.
    465469 * @return array
    466470 */
     
    822826
    823827/**
    824  * Creates a new post from the "Write Post" form using $_POST information.
     828 * Creates a new post from the "Write Post" form using `$_POST` information.
    825829 *
    826830 * @since 2.1.0
     
    920924
    921925/**
    922  * Adds post meta data defined in $_POST superglobal for post with given ID.
     926 * Adds post meta data defined in the `$_POST` superglobal for a post with given ID.
    923927 *
    924928 * @since 1.2.0
     
    10491053 * @since 1.2.0
    10501054 *
    1051  * @param int    $meta_id
    1052  * @param string $meta_key   Expect Slashed.
    1053  * @param string $meta_value Expect Slashed.
     1055 * @param int    $meta_id    Meta ID.
     1056 * @param string $meta_key   Meta key. Expect slashed.
     1057 * @param string $meta_value Meta value. Expect slashed.
    10541058 * @return bool
    10551059 */
     
    11231127
    11241128/**
    1125  * Returns all the possible statuses for a post_type.
     1129 * Returns all the possible statuses for a post type.
    11261130 *
    11271131 * @since 2.5.0
     
    11371141
    11381142/**
    1139  * Runs the wp query to fetch the posts for listing on the edit posts page
     1143 * Runs the query to fetch the posts for listing on the edit posts page.
    11401144 *
    11411145 * @since 2.5.0
    11421146 *
    1143  * @param array|false $q Array of query variables to use to build the query or false to use $_GET superglobal.
     1147 * @param array|false $q Optional. Array of query variables to use to build the query.
     1148 *                       Defaults to the `$_GET` superglobal.
    11441149 * @return array
    11451150 */
     
    12421247 * @since 4.2.0
    12431248 *
    1244  * @param array|false $q Optional. Array of query variables to use to build the query or false
    1245  *                       to use $_GET superglobal. Default false.
     1249 * @param array|false $q Optional. Array of query variables to use to build the query.
     1250 *                       Defaults to the `$_GET` superglobal.
    12461251 * @return array The parsed query vars.
    12471252 */
     
    13101315 * @since 2.5.0
    13111316 *
    1312  * @param array|false $q Array of query variables to use to build the query or false to use $_GET superglobal.
     1317 * @param array|false $q Optional. Array of query variables to use to build the query.
     1318 *                       Defaults to the `$_GET` superglobal.
    13131319 * @return array
    13141320 */
     
    13651371 *
    13661372 * @param int|WP_Post $id    Post ID or post object.
    1367  * @param string      $title Optional. Title to override the post's current title when generating the post name. Default null.
    1368  * @param string      $name  Optional. Name to override the post name. Default null.
     1373 * @param string|null $title Optional. Title to override the post's current title
     1374 *                           when generating the post name. Default null.
     1375 * @param string|null $name  Optional. Name to override the post name. Default null.
    13691376 * @return array {
    13701377 *     Array containing the sample permalink with placeholder for the post name, and the post name.
     
    14551462 * @since 2.5.0
    14561463 *
    1457  * @param int    $id        Post ID or post object.
    1458  * @param string $new_title Optional. New title. Default null.
    1459  * @param string $new_slug  Optional. New slug. Default null.
     1464 * @param int|WP_Post $id        Post ID or post object.
     1465 * @param string|null $new_title Optional. New title. Default null.
     1466 * @param string|null $new_slug  Optional. New slug. Default null.
    14601467 * @return string The HTML of the sample permalink slug editor.
    14611468 */
     
    15411548 * @since 2.9.0
    15421549 *
    1543  * @param int         $thumbnail_id ID of the attachment used for thumbnail
    1544  * @param int|WP_Post $post         Optional. The post ID or object associated with the thumbnail, defaults to global $post.
     1550 * @param int|null         $thumbnail_id Optional. Thumbnail attachment ID. Default null.
     1551 * @param int|WP_Post|null $post         Optional. The post ID or object associated
     1552 *                                       with the thumbnail. Defaults to global $post.
    15451553 * @return string The post thumbnail HTML.
    15461554 */
     
    18381846
    18391847/**
    1840  * Creates autosave data for the specified post from $_POST data.
     1848 * Creates autosave data for the specified post from `$_POST` data.
    18411849 *
    18421850 * @since 2.6.0
    18431851 *
    1844  * @param array|int $post_data Associative array containing the post data or int post ID.
     1852 * @param array|int $post_data Associative array containing the post data, or integer post ID.
     1853 *                             If a numeric post ID is provided, will use the `$_POST` superglobal.
    18451854 * @return int|WP_Error The autosave revision ID. WP_Error or 0 on error.
    18461855 */
Note: See TracChangeset for help on using the changeset viewer.