Changeset 52251
- Timestamp:
- 11/26/2021 12:26:17 AM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/post.php
r52249 r52251 8 8 9 9 /** 10 * Renames $_POSTdata from form names to DB post columns.11 * 12 * Manipulates $_POSTdirectly.10 * Renames `$_POST` data from form names to DB post columns. 11 * 12 * Manipulates `$_POST` directly. 13 13 * 14 14 * @since 2.6.0 15 15 * 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. 18 19 * @return array|WP_Error Array of post data on success, WP_Error on failure. 19 20 */ … … 209 210 * @since 5.0.1 210 211 * 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. 212 214 * @return array|WP_Error Array of post data on success, WP_Error on failure. 213 215 */ … … 226 228 227 229 /** 228 * Updates an existing post with values provided in $_POST.230 * Updates an existing post with values provided in `$_POST`. 229 231 * 230 232 * If post data is passed as an argument, it is treated as an array of data 231 233 * keyed appropriately for turning into a post object. 232 234 * 233 * If post data is not passed, the $_POSTglobal variable is used instead.235 * If post data is not passed, the `$_POST` global variable is used instead. 234 236 * 235 237 * @since 1.5.0 … … 237 239 * @global wpdb $wpdb WordPress database abstraction object. 238 240 * 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. 240 243 * @return int Post ID. 241 244 */ … … 462 465 * @global wpdb $wpdb WordPress database abstraction object. 463 466 * 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. 465 469 * @return array 466 470 */ … … 822 826 823 827 /** 824 * Creates a new post from the "Write Post" form using $_POSTinformation.828 * Creates a new post from the "Write Post" form using `$_POST` information. 825 829 * 826 830 * @since 2.1.0 … … 920 924 921 925 /** 922 * Adds post meta data defined in $_POST superglobal forpost with given ID.926 * Adds post meta data defined in the `$_POST` superglobal for a post with given ID. 923 927 * 924 928 * @since 1.2.0 … … 1049 1053 * @since 1.2.0 1050 1054 * 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. 1054 1058 * @return bool 1055 1059 */ … … 1123 1127 1124 1128 /** 1125 * Returns all the possible statuses for a post _type.1129 * Returns all the possible statuses for a post type. 1126 1130 * 1127 1131 * @since 2.5.0 … … 1137 1141 1138 1142 /** 1139 * Runs the wp query to fetch the posts for listing on the edit posts page1143 * Runs the query to fetch the posts for listing on the edit posts page. 1140 1144 * 1141 1145 * @since 2.5.0 1142 1146 * 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. 1144 1149 * @return array 1145 1150 */ … … 1242 1247 * @since 4.2.0 1243 1248 * 1244 * @param array|false $q Optional. Array of query variables to use to build the query or false1245 * 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. 1246 1251 * @return array The parsed query vars. 1247 1252 */ … … 1310 1315 * @since 2.5.0 1311 1316 * 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. 1313 1319 * @return array 1314 1320 */ … … 1365 1371 * 1366 1372 * @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. 1369 1376 * @return array { 1370 1377 * Array containing the sample permalink with placeholder for the post name, and the post name. … … 1455 1462 * @since 2.5.0 1456 1463 * 1457 * @param int 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. 1460 1467 * @return string The HTML of the sample permalink slug editor. 1461 1468 */ … … 1541 1548 * @since 2.9.0 1542 1549 * 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. 1545 1553 * @return string The post thumbnail HTML. 1546 1554 */ … … 1838 1846 1839 1847 /** 1840 * Creates autosave data for the specified post from $_POSTdata.1848 * Creates autosave data for the specified post from `$_POST` data. 1841 1849 * 1842 1850 * @since 2.6.0 1843 1851 * 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. 1845 1854 * @return int|WP_Error The autosave revision ID. WP_Error or 0 on error. 1846 1855 */
Note: See TracChangeset
for help on using the changeset viewer.