Make WordPress Core

Changeset 11222


Ignore:
Timestamp:
05/06/2009 08:49:36 PM (15 years ago)
Author:
westi
Message:

Updates phpDoc for the post functions. See #8805 props CharlesClarkson.

File:
1 edited

Legend:

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

    r11204 r11222  
    418418 *
    419419 * @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.
    421422 * @return int Amount of rows changed. Should be 1 for success and 0 for failure.
    422423 */
     
    457458 * @link http://codex.wordpress.org/Template_Tags/get_posts
    458459 *
    459  * @param array $args Optional. Override defaults.
     460 * @param array $args Optional. Overrides defaults.
    460461 * @return array List of posts.
    461462 */
     
    593594 * @param string $key The meta key to retrieve.
    594595 * @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.
    596598 */
    597599function get_post_meta($post_id, $key, $single = false) {
     
    828830 * Sanitize post field based on context.
    829831 *
    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.
    832835 *
    833836 * @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_'.
    834848 *
    835849 * @param string $field The Post Object field name.
    836850 * @param mixed $value The Post Object value.
    837851 * @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'.
    839854 * @return mixed Sanitized value.
    840855 */
     
    10321047 * @since 2.5.0
    10331048 *
    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*).
    10351051 * @param string|array $real_mime_types post_mime_type values
    10361052 * @return array array(wildcard=>array(real types))
     
    11121128 *
    11131129 * @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'.
    11151133 *
    11161134 * @param int $postid Post ID.
    1117  * @return mixed
     1135 * @return mixed False on failure
    11181136 */
    11191137function wp_delete_post($postid = 0) {
     
    12131231 *
    12141232 * 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 override in
     1233 * is set to 'all'. There are other defaults that can be overridden in
    12161234 * {@link wp_get_object_terms()}.
    12171235 *
     
    12341252 *
    12351253 * 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 override in
     1254 * is set to 'all'. There are other defaults that can be overridden in
    12371255 * {@link wp_get_object_terms()}.
    12381256 *
     
    13231341 *
    13241342 * 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.
    13391354 *     'post_content_filtered' - Post content filtered.
    1340  *     'post_excerpt' - Post excerpt.
     1355 *     'post_excerpt'  - Post excerpt.
    13411356 *
    13421357 * @since 1.0.0
     1358 * @link http://core.trac.wordpress.org/ticket/9084 Bug report on 'wp_insert_post_data' filter.
    13431359 * @uses $wpdb
    13441360 * @uses $wp_rewrite
    13451361 * @uses $user_ID
    13461362 *
    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.
    13481373 * @param bool $wp_error Optional. Allow return of WP_Error on failure.
    13491374 * @return int|WP_Error The value 0 or WP_Error on failure. The post ID on success.
     
    18221847 * The first is 'transition_post_status' with new status, old status, and post data.
    18231848 *
    1824  * The next action called is 'OLDSTATUS_to_NEWSTATUS' the NEWSTATUS is the
    1825  * $new_status parameter and the OLDSTATUS is $old_status parameter; it has the
     1849 * 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
    18261851 * post data.
    18271852 *
    1828  * The final action is named 'NEWSTATUS_POSTTYPE', NEWSTATUS is from the $new_status
     1853 * The final action is named 'NEWSTATUS_POSTTYPE', 'NEWSTATUS' is from the $new_status
    18291854 * parameter and POSTTYPE is post_type post data.
    18301855 *
    18311856 * @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.
    18321863 *
    18331864 * @param string $new_status Transition to this post status.
     
    20982129 * Order the pages with children under parents in a flat list.
    20992130 *
    2100  * Fetches the pages returned as a FLAT list, but arranged in order of their
    2101  * hierarchy, i.e., child parents immediately follow their parents.
    2102  *
    21032131 * @since 2.0.0
    21042132 *
    21052133 * @param array $posts Posts array.
    21062134 * @param int $parent Parent page ID.
    2107  * @return array
     2135 * @return array A list arranged by hierarchy. Children immediately follow their parents.
    21082136 */
    21092137function get_page_hierarchy($posts, $parent = 0) {
     
    23452373 *
    23462374 * 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.
    23632387 *     'post_content_filtered' - Attachment post content filtered.
    2364  *     'post_excerpt' - Attachment excerpt.
     2388 *     'post_excerpt'  - Attachment excerpt.
    23652389 *
    23662390 * @since 2.0.0
    23672391 * @uses $wpdb
    23682392 * @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.
    23692395 *
    23702396 * @param string|array $object Arguments to override defaults.
     
    30093035 * object cache associated with the post ID.
    30103036 *
     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 *
    30113042 * @package WordPress
    30123043 * @subpackage Cache
    30133044 * @since 2.0.0
    30143045 *
    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).
    30163047 *
    30173048 * @param int $id The Post ID in the cache to clean
     
    31883219 * @access private
    31893220 * @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.
    31903223 *
    31913224 * @param string $new_status New post status
     
    32133246 *
    32143247 * @since 2.3.0
     3248 * @access private
    32153249 *
    32163250 * @param int $deprecated Not Used. Can be set to null.
     
    32263260 *
    32273261 * @since 2.3.0
     3262 * @access private
    32283263 * @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.
    32333267 *
    32343268 * @param int $post_id The ID in the database table of the post being published
     
    32653299 *
    32663300 * @since 2.3.0
     3301 * @access private
    32673302 * @uses $wp_rewrite Flushes Rewrite Rules.
    32683303 *
     
    32953330 * parent will be an ancestor. There will only be two ancestors at the most.
    32963331 *
     3332 * @since unknown
    32973333 * @access private
    3298  * @since unknown
    32993334 * @uses $wpdb
    33003335 *
     
    33323367 * @since 2.6.0
    33333368 * @access private
     3369 * @uses apply_filters() Calls '_wp_post_revision_fields' on 'title', 'content' and 'excerpt' fields.
    33343370 *
    33353371 * @param array $post Optional a post array to be processed for insertion as a post revision.
     
    35863622 * Restores a post to the specified revision.
    35873623 *
    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.
    35903625 *
    35913626 * @package WordPress
     
    35953630 * @uses wp_get_post_revision()
    35963631 * @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.
    35973634 *
    35983635 * @param int|object $revision_id Revision ID or revision object.
    3599  * @param array $fields Optional. What fields to restore from.  Defaults to all.
     3636 * @param array $fields Optional. What fields to restore from. Defaults to all.
    36003637 * @return mixed Null if error, false if no fields to restore, (int) post ID if success.
    36013638 */
Note: See TracChangeset for help on using the changeset viewer.