Make WordPress Core

Changeset 29092


Ignore:
Timestamp:
07/11/2014 08:15:52 AM (10 years ago)
Author:
DrewAPicture
Message:

General inline documentation improvements in wp-includes/post.php.

Second-run. See #25412.

File:
1 edited

Legend:

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

    r29091 r29092  
    12771277 *                                  inherits from $permalink_epmask. If not specified and permalink_epmask
    12781278 *                                  is not set, defaults to EP_PERMALINK.
    1279  * }
     1279 *     }
    12801280 *     @type string|bool $query_var            Sets the query_var key for this post type. Defaults to $post_type
    12811281 *                                             key. If false, a post type cannot be loaded at
     
    14401440    }
    14411441
     1442    // Register the post type meta box if a custom callback was specified.
    14421443    if ( $args->register_meta_box_cb )
    14431444        add_action( 'add_meta_boxes_' . $post_type, $args->register_meta_box_cb, 10, 1 );
     
    14681469
    14691470/**
    1470  * Builds an object with all post type capabilities out of a post type object
     1471 * Build an object with all post type capabilities out of a post type object
    14711472 *
    14721473 * Post type capabilities use the 'capability_type' argument as a base, if the
     
    15141515 * argument set to true (default is false).
    15151516 *
     1517 * @since 3.0.0
     1518 *
     1519 * @see register_post_type()
    15161520 * @see map_meta_cap()
    1517  * @since 3.0.0
    1518  *
    1519  * @param object $args Post type registration arguments
    1520  * @return object object with all the capabilities as member variables
     1521 *
     1522 * @param object $args Post type registration arguments.
     1523 * @return object object with all the capabilities as member variables.
    15211524 */
    15221525function get_post_type_capabilities( $args ) {
     
    15671570
    15681571/**
    1569  * Stores or returns a list of post type meta caps for map_meta_cap().
     1572 * Store or return a list of post type meta caps for map_meta_cap().
    15701573 *
    15711574 * @since 3.1.0
    15721575 * @access private
     1576 *
     1577 * @param null|array $capabilities Post type meta capabilities.
    15731578 */
    15741579function _post_type_meta_capabilities( $capabilities = null ) {
     
    15831588
    15841589/**
    1585  * Builds an object with all post type labels out of a post type object
     1590 * Build an object with all post type labels out of a post type object
    15861591 *
    15871592 * Accepted keys of the label array in the post type object:
    1588  * - name - general name for the post type, usually plural. The same and overridden by $post_type_object->label. Default is Posts/Pages
     1593 * - name - general name for the post type, usually plural. The same and overridden
     1594 *          by $post_type_object->label. Default is Posts/Pages
    15891595 * - singular_name - name for one object of this post type. Default is Post/Page
    1590  * - add_new - Default is Add New for both hierarchical and non-hierarchical types. When internationalizing this string, please use a {@link http://codex.wordpress.org/I18n_for_WordPress_Developers#Disambiguation_by_context gettext context} matching your post type. Example: <code>_x('Add New', 'product');</code>
    1591  * - add_new_item - Default is Add New Post/Add New Page
    1592  * - edit_item - Default is Edit Post/Edit Page
    1593  * - new_item - Default is New Post/New Page
    1594  * - view_item - Default is View Post/View Page
    1595  * - search_items - Default is Search Posts/Search Pages
    1596  * - not_found - Default is No posts found/No pages found
    1597  * - not_found_in_trash - Default is No posts found in Trash/No pages found in Trash
    1598  * - parent_item_colon - This string isn't used on non-hierarchical types. In hierarchical ones the default is Parent Page:
    1599  * - all_items - String for the submenu. Default is All Posts/All Pages
    1600  * - menu_name - Default is the same as <code>name</code>
    1601  *
    1602  * Above, the first default value is for non-hierarchical post types (like posts) and the second one is for hierarchical post types (like pages).
     1596 * - add_new - Default is Add New for both hierarchical and non-hierarchical types.
     1597 *             When internationalizing this string, please use a gettext context
     1598 *             {@see http://codex.wordpress.org/I18n_for_WordPress_Developers#Disambiguation_by_context}
     1599 *             matching your post type. Example: <code>_x('Add New', 'product');</code>.
     1600 * - add_new_item - Default is Add New Post/Add New Page.
     1601 * - edit_item - Default is Edit Post/Edit Page.
     1602 * - new_item - Default is New Post/New Page.
     1603 * - view_item - Default is View Post/View Page.
     1604 * - search_items - Default is Search Posts/Search Pages.
     1605 * - not_found - Default is No posts found/No pages found.
     1606 * - not_found_in_trash - Default is No posts found in Trash/No pages found in Trash.
     1607 * - parent_item_colon - This string isn't used on non-hierarchical types. In hierarchical
     1608 *                       ones the default is 'Parent Page:'.
     1609 * - all_items - String for the submenu. Default is All Posts/All Pages.
     1610 * - menu_name - Default is the same as <code>name</code>.
     1611 *
     1612 * Above, the first default value is for non-hierarchical post types (like posts)
     1613 * and the second one is for hierarchical post types (like pages).
    16031614 *
    16041615 * @since 3.0.0
    16051616 * @access private
    16061617 *
    1607  * @param object $post_type_object
    1608  * @return object object with all the labels as member variables
     1618 * @param object $post_type_object Post type object.
     1619 * @return object object with all the labels as member variables.
    16091620 */
    16101621function get_post_type_labels( $post_type_object ) {
     
    16451656
    16461657/**
    1647  * Builds an object with custom-something object (post type, taxonomy) labels out of a custom-something object
    1648  *
     1658 * Build an object with custom-something object (post type, taxonomy) labels
     1659 * out of a custom-something object
     1660 *
     1661 * @since 3.0.0
    16491662 * @access private
    1650  * @since 3.0.0
     1663 *
     1664 * @param object $object                  A custom-something object.
     1665 * @param array  $nohier_vs_hier_defaults Hierarchical vs non-hierarchical default labels.
    16511666 */
    16521667function _get_custom_object_labels( $object, $nohier_vs_hier_defaults ) {
     
    16761691
    16771692/**
    1678  * Adds submenus for post types.
     1693 * Add submenus for post types.
    16791694 *
    16801695 * @access private
     
    17071722 *
    17081723 * @param string       $post_type The post type for which to add the feature.
    1709  * @param string|array $feature   The feature being added, accpets an array of
     1724 * @param string|array $feature   The feature being added, accepts an array of
    17101725 *                                feature strings or a single string.
    17111726 */
     
    17261741 *
    17271742 * @since 3.0.0
    1728  * @param string $post_type The post type for which to remove the feature
    1729  * @param string $feature The feature being removed
     1743 *
     1744 * @param string $post_type The post type for which to remove the feature.
     1745 * @param string $feature   The feature being removed.
    17301746 */
    17311747function remove_post_type_support( $post_type, $feature ) {
     
    17401756 *
    17411757 * @since 3.4.0
    1742  * @param string $post_type The post type
    1743  * @return array
    1744  */
    1745 
     1758 *
     1759 * @param string $post_type The post type.
     1760 * @return array Post type supports list.
     1761 */
    17461762function get_all_post_type_supports( $post_type ) {
    17471763    global $_wp_post_type_features;
     
    17541770
    17551771/**
    1756  * Checks a post type's support for a given feature
     1772 * Check a post type's support for a given feature.
    17571773 *
    17581774 * @since 3.0.0
    1759  * @param string $post_type The post type being checked
    1760  * @param string $feature the feature being checked
    1761  * @return boolean
    1762  */
    1763 
     1775 *
     1776 * @param string $post_type The post type being checked.
     1777 * @param string $feature the feature being checked.
     1778 * @return bool Whether the post type supports the given feature.
     1779 */
    17641780function post_type_supports( $post_type, $feature ) {
    17651781    global $_wp_post_type_features;
     
    17691785
    17701786/**
    1771  * Updates the post type for the post ID.
     1787 * Update the post type for the post ID.
    17721788 *
    17731789 * The page or post cache will be cleaned for the post ID.
     
    17751791 * @since 2.5.0
    17761792 *
    1777  * @uses $wpdb
    1778  *
    1779  * @param int $post_id Post ID to change post type. Not actually optional.
    1780  * @param string $post_type Optional, default is post. Supported values are 'post' or 'page' to
    1781  *  name a few.
     1793 * @global wpdb $wpdb WordPress database access abstraction object.
     1794 *
     1795 * @param int    $post_id   Optional. Post ID to change post type. Default 0.
     1796 * @param string $post_type Optional. Post type. Accepts 'post' or 'page' to
     1797 *                          name a few. Default 'post'.
    17821798 * @return int Amount of rows changed. Should be 1 for success and 0 for failure.
    17831799 */
     
    18111827 *
    18121828 * @since 1.2.0
    1813  * @uses WP_Query::query() See for more default arguments and information.
    1814  * @link http://codex.wordpress.org/Template_Tags/get_posts
     1829 *
     1830 * @todo Tie to WP_Query default args hash notation.
     1831 *
     1832 * @see WP_Query::query() See for more default arguments and information.
     1833 * @see http://codex.wordpress.org/Template_Tags/get_posts
    18151834 *
    18161835 * @param array $args Optional. Overrides defaults.
    18171836 * @return array List of posts.
    18181837 */
    1819 function get_posts($args = null) {
     1838function get_posts( $args = null ) {
    18201839    $defaults = array(
    18211840        'numberposts' => 5, 'offset' => 0,
Note: See TracChangeset for help on using the changeset viewer.