Changeset 11222
- Timestamp:
- 05/06/2009 08:49:36 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/post.php
r11204 r11222 418 418 * 419 419 * @param int $post_id Post ID to change post type. Not actually optional. 420 * @param string $post_type Optional, default is post. Supported values are 'post' or 'page' to name a few. 420 * @param string $post_type Optional, default is post. Supported values are 'post' or 'page' to 421 * name a few. 421 422 * @return int Amount of rows changed. Should be 1 for success and 0 for failure. 422 423 */ … … 457 458 * @link http://codex.wordpress.org/Template_Tags/get_posts 458 459 * 459 * @param array $args Optional. Override defaults.460 * @param array $args Optional. Overrides defaults. 460 461 * @return array List of posts. 461 462 */ … … 593 594 * @param string $key The meta key to retrieve. 594 595 * @param bool $single Whether to return a single value. 595 * @return mixed Will be an array if $single is false. Will be value of meta data field if $single is true. 596 * @return mixed Will be an array if $single is false. Will be value of meta data field if $single 597 * is true. 596 598 */ 597 599 function get_post_meta($post_id, $key, $single = false) { … … 828 830 * Sanitize post field based on context. 829 831 * 830 * Possible context values are: raw, edit, db, attribute, js, and display. The 831 * display context is used by default. 832 * Possible context values are: 'raw', 'edit', 'db', 'display', 'attribute' and 'js'. The 833 * 'display' context is used by default. 'attribute' and 'js' contexts are treated like 'display' 834 * when calling filters. 832 835 * 833 836 * @since 2.3.0 837 * @uses apply_filters() Calls 'edit_$field' and '${field_no_prefix}_edit_pre' passing $value and 838 * $post_id if $context == 'edit' and field name prefix == 'post_'. 839 * 840 * @uses apply_filters() Calls 'edit_post_$field' passing $value and $post_id if $context == 'db'. 841 * @uses apply_filters() Calls 'pre_$field' passing $value if $context == 'db' and field name prefix == 'post_'. 842 * @uses apply_filters() Calls '${field}_pre' passing $value if $context == 'db' and field name prefix != 'post_'. 843 * 844 * @uses apply_filters() Calls '$field' passing $value, $post_id and $context if $context == anything 845 * other than 'raw', 'edit' and 'db' and field name prefix == 'post_'. 846 * @uses apply_filters() Calls 'post_$field' passing $value if $context == anything other than 'raw', 847 * 'edit' and 'db' and field name prefix != 'post_'. 834 848 * 835 849 * @param string $field The Post Object field name. 836 850 * @param mixed $value The Post Object value. 837 851 * @param int $post_id Post ID. 838 * @param string $context How to sanitize post fields. 852 * @param string $context How to sanitize post fields. Looks for 'raw', 'edit', 'db', 'display', 853 * 'attribute' and 'js'. 839 854 * @return mixed Sanitized value. 840 855 */ … … 1032 1047 * @since 2.5.0 1033 1048 * 1034 * @param string|array $wildcard_mime_types e.g. audio/mpeg or image (same as image/*) or flash (same as *flash*) 1049 * @param string|array $wildcard_mime_types e.g. audio/mpeg or image (same as image/*) or 1050 * flash (same as *flash*). 1035 1051 * @param string|array $real_mime_types post_mime_type values 1036 1052 * @return array array(wildcard=>array(real types)) … … 1112 1128 * 1113 1129 * @since 1.0.0 1114 * @uses do_action() Calls 'deleted_post' hook on post ID. 1130 * @uses do_action() on 'delete_post' before deletion unless post type is 'attachment'. 1131 * @uses do_action() on 'deleted_post' after deletion unless post type is 'attachment'. 1132 * @uses wp_delete_attachment() if post type is 'attachment'. 1115 1133 * 1116 1134 * @param int $postid Post ID. 1117 * @return mixed 1135 * @return mixed False on failure 1118 1136 */ 1119 1137 function wp_delete_post($postid = 0) { … … 1213 1231 * 1214 1232 * There is only one default for this function, called 'fields' and by default 1215 * is set to 'all'. There are other defaults that can be overrid ein1233 * is set to 'all'. There are other defaults that can be overridden in 1216 1234 * {@link wp_get_object_terms()}. 1217 1235 * … … 1234 1252 * 1235 1253 * There is only one default for this function, called 'fields' and by default 1236 * is set to 'all'. There are other defaults that can be overrid ein1254 * is set to 'all'. There are other defaults that can be overridden in 1237 1255 * {@link wp_get_object_terms()}. 1238 1256 * … … 1323 1341 * 1324 1342 * The defaults for the parameter $postarr are: 1325 * 'post_status' - Default is 'draft'. 1326 * 'post_type' - Default is 'post'. 1327 * 'post_author' - Default is current user ID. The ID of the user, who added 1328 * the post. 1329 * 'ping_status' - Default is the value in default ping status option. 1330 * Whether the attachment can accept pings. 1331 * 'post_parent' - Default is 0. Set this for the post it belongs to, if 1332 * any. 1333 * 'menu_order' - Default is 0. The order it is displayed. 1334 * 'to_ping' - Whether to ping. 1335 * 'pinged' - Default is empty string. 1336 * 'post_password' - Default is empty string. The password to access the 1337 * attachment. 1338 * 'guid' - Global Unique ID for referencing the attachment. 1343 * 'post_status' - Default is 'draft'. 1344 * 'post_type' - Default is 'post'. 1345 * 'post_author' - Default is current user ID ($user_ID). The ID of the user who added the post. 1346 * 'ping_status' - Default is the value in 'default_ping_status' option. 1347 * Whether the attachment can accept pings. 1348 * 'post_parent' - Default is 0. Set this for the post it belongs to, if any. 1349 * 'menu_order' - Default is 0. The order it is displayed. 1350 * 'to_ping' - Whether to ping. 1351 * 'pinged' - Default is empty string. 1352 * 'post_password' - Default is empty string. The password to access the attachment. 1353 * 'guid' - Global Unique ID for referencing the attachment. 1339 1354 * 'post_content_filtered' - Post content filtered. 1340 * 'post_excerpt' - Post excerpt.1355 * 'post_excerpt' - Post excerpt. 1341 1356 * 1342 1357 * @since 1.0.0 1358 * @link http://core.trac.wordpress.org/ticket/9084 Bug report on 'wp_insert_post_data' filter. 1343 1359 * @uses $wpdb 1344 1360 * @uses $wp_rewrite 1345 1361 * @uses $user_ID 1346 1362 * 1347 * @param array $postarr Optional. Override defaults. 1363 * @uses do_action() Calls 'pre_post_update' on post ID if this is an update. 1364 * @uses do_action() Calls 'edit_post' action on post ID and post data if this is an update. 1365 * @uses do_action() Calls 'save_post' and 'wp_insert_post' on post id and post data just before 1366 * returning. 1367 * 1368 * @uses apply_filters() Calls 'wp_insert_post_data' passing $data, $postarr prior to database 1369 * update or insert. 1370 * @uses wp_transition_post_status() 1371 * 1372 * @param array $postarr Optional. Overrides defaults. 1348 1373 * @param bool $wp_error Optional. Allow return of WP_Error on failure. 1349 1374 * @return int|WP_Error The value 0 or WP_Error on failure. The post ID on success. … … 1822 1847 * The first is 'transition_post_status' with new status, old status, and post data. 1823 1848 * 1824 * The next action called is 'OLDSTATUS_to_NEWSTATUS' the NEWSTATUSis the1825 * $new_status parameter and the OLDSTATUSis $old_status parameter; it has the1849 * The next action called is 'OLDSTATUS_to_NEWSTATUS' the 'NEWSTATUS' is the 1850 * $new_status parameter and the 'OLDSTATUS' is $old_status parameter; it has the 1826 1851 * post data. 1827 1852 * 1828 * The final action is named 'NEWSTATUS_POSTTYPE', NEWSTATUSis from the $new_status1853 * The final action is named 'NEWSTATUS_POSTTYPE', 'NEWSTATUS' is from the $new_status 1829 1854 * parameter and POSTTYPE is post_type post data. 1830 1855 * 1831 1856 * @since 2.3.0 1857 * @link http://codex.wordpress.org/Post_Status_Transitions 1858 * 1859 * @uses do_action() Calls 'transition_post_status' on $new_status, $old_status and 1860 * $post if there is a status change. 1861 * @uses do_action() Calls '${old_status}_to_$new_status' on $post if there is a status change. 1862 * @uses do_action() Calls '${new_status}_$post->post_type' on post ID and $post. 1832 1863 * 1833 1864 * @param string $new_status Transition to this post status. … … 2098 2129 * Order the pages with children under parents in a flat list. 2099 2130 * 2100 * Fetches the pages returned as a FLAT list, but arranged in order of their2101 * hierarchy, i.e., child parents immediately follow their parents.2102 *2103 2131 * @since 2.0.0 2104 2132 * 2105 2133 * @param array $posts Posts array. 2106 2134 * @param int $parent Parent page ID. 2107 * @return array 2135 * @return array A list arranged by hierarchy. Children immediately follow their parents. 2108 2136 */ 2109 2137 function get_page_hierarchy($posts, $parent = 0) { … … 2345 2373 * 2346 2374 * The $object parameter can have the following: 2347 * 'post_status' - Default is 'draft'. Can not be override, set the same as 2348 * parent post. 2349 * 'post_type' - Default is 'post', will be set to attachment. Can not 2350 * override. 2351 * 'post_author' - Default is current user ID. The ID of the user, who added 2352 * the attachment. 2353 * 'ping_status' - Default is the value in default ping status option. 2354 * Whether the attachment can accept pings. 2355 * 'post_parent' - Default is 0. Can use $parent parameter or set this for 2356 * the post it belongs to, if any. 2357 * 'menu_order' - Default is 0. The order it is displayed. 2358 * 'to_ping' - Whether to ping. 2359 * 'pinged' - Default is empty string. 2360 * 'post_password' - Default is empty string. The password to access the 2361 * attachment. 2362 * 'guid' - Global Unique ID for referencing the attachment. 2375 * 'post_status' - Default is 'draft'. Can not be overridden, set the same as parent post. 2376 * 'post_type' - Default is 'post', will be set to attachment. Can not override. 2377 * 'post_author' - Default is current user ID. The ID of the user, who added the attachment. 2378 * 'ping_status' - Default is the value in default ping status option. Whether the attachment 2379 * can accept pings. 2380 * 'post_parent' - Default is 0. Can use $parent parameter or set this for the post it belongs 2381 * to, if any. 2382 * 'menu_order' - Default is 0. The order it is displayed. 2383 * 'to_ping' - Whether to ping. 2384 * 'pinged' - Default is empty string. 2385 * 'post_password' - Default is empty string. The password to access the attachment. 2386 * 'guid' - Global Unique ID for referencing the attachment. 2363 2387 * 'post_content_filtered' - Attachment post content filtered. 2364 * 'post_excerpt' - Attachment excerpt.2388 * 'post_excerpt' - Attachment excerpt. 2365 2389 * 2366 2390 * @since 2.0.0 2367 2391 * @uses $wpdb 2368 2392 * @uses $user_ID 2393 * @uses do_action() Calls 'edit_attachment' on $post_ID if this is an update. 2394 * @uses do_action() Calls 'add_attachment' on $post_ID if this is not an update. 2369 2395 * 2370 2396 * @param string|array $object Arguments to override defaults. … … 3009 3035 * object cache associated with the post ID. 3010 3036 * 3037 * clean_post_cache() will call itself recursively for each child post. 3038 * 3039 * This function not run if $_wp_suspend_cache_invalidation is not empty. See 3040 * wp_suspend_cache_invalidation(). 3041 * 3011 3042 * @package WordPress 3012 3043 * @subpackage Cache 3013 3044 * @since 2.0.0 3014 3045 * 3015 * @uses do_action() Will call the 'clean_post_cache' hook action.3046 * @uses do_action() Calls 'clean_post_cache' on $id before adding children (if any). 3016 3047 * 3017 3048 * @param int $id The Post ID in the cache to clean … … 3188 3219 * @access private 3189 3220 * @uses $wpdb 3221 * @uses do_action() Calls 'private_to_published' on post ID if this is a 'private_to_published' call. 3222 * @uses wp_clear_scheduled_hook() with 'publish_future_post' and post ID. 3190 3223 * 3191 3224 * @param string $new_status New post status … … 3213 3246 * 3214 3247 * @since 2.3.0 3248 * @access private 3215 3249 * 3216 3250 * @param int $deprecated Not Used. Can be set to null. … … 3226 3260 * 3227 3261 * @since 2.3.0 3262 * @access private 3228 3263 * @uses $wpdb 3229 * @uses XMLRPC_REQUEST 3230 * @uses APP_REQUEST 3231 * @uses do_action Calls 'xmlprc_publish_post' action if XMLRPC_REQUEST is defined. Calls 'app_publish_post' 3232 * action if APP_REQUEST is defined. 3264 * @uses XMLRPC_REQUEST and APP_REQUEST constants. 3265 * @uses do_action() Calls 'xmlprc_publish_post' on post ID if XMLRPC_REQUEST is defined. 3266 * @uses do_action() Calls 'app_publish_post' on post ID if APP_REQUEST is defined. 3233 3267 * 3234 3268 * @param int $post_id The ID in the database table of the post being published … … 3265 3299 * 3266 3300 * @since 2.3.0 3301 * @access private 3267 3302 * @uses $wp_rewrite Flushes Rewrite Rules. 3268 3303 * … … 3295 3330 * parent will be an ancestor. There will only be two ancestors at the most. 3296 3331 * 3332 * @since unknown 3297 3333 * @access private 3298 * @since unknown3299 3334 * @uses $wpdb 3300 3335 * … … 3332 3367 * @since 2.6.0 3333 3368 * @access private 3369 * @uses apply_filters() Calls '_wp_post_revision_fields' on 'title', 'content' and 'excerpt' fields. 3334 3370 * 3335 3371 * @param array $post Optional a post array to be processed for insertion as a post revision. … … 3586 3622 * Restores a post to the specified revision. 3587 3623 * 3588 * Can restore a past using all fields of the post revision, or only selected 3589 * fields. 3624 * Can restore a past revision using all fields of the post revision, or only selected fields. 3590 3625 * 3591 3626 * @package WordPress … … 3595 3630 * @uses wp_get_post_revision() 3596 3631 * @uses wp_update_post() 3632 * @uses do_action() Calls 'wp_restore_post_revision' on post ID and revision ID if wp_update_post() 3633 * is successful. 3597 3634 * 3598 3635 * @param int|object $revision_id Revision ID or revision object. 3599 * @param array $fields Optional. What fields to restore from. 3636 * @param array $fields Optional. What fields to restore from. Defaults to all. 3600 3637 * @return mixed Null if error, false if no fields to restore, (int) post ID if success. 3601 3638 */
Note: See TracChangeset
for help on using the changeset viewer.