Changeset 29092
- Timestamp:
- 07/11/2014 08:15:52 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/post.php
r29091 r29092 1277 1277 * inherits from $permalink_epmask. If not specified and permalink_epmask 1278 1278 * is not set, defaults to EP_PERMALINK. 1279 * }1279 * } 1280 1280 * @type string|bool $query_var Sets the query_var key for this post type. Defaults to $post_type 1281 1281 * key. If false, a post type cannot be loaded at … … 1440 1440 } 1441 1441 1442 // Register the post type meta box if a custom callback was specified. 1442 1443 if ( $args->register_meta_box_cb ) 1443 1444 add_action( 'add_meta_boxes_' . $post_type, $args->register_meta_box_cb, 10, 1 ); … … 1468 1469 1469 1470 /** 1470 * Build san object with all post type capabilities out of a post type object1471 * Build an object with all post type capabilities out of a post type object 1471 1472 * 1472 1473 * Post type capabilities use the 'capability_type' argument as a base, if the … … 1514 1515 * argument set to true (default is false). 1515 1516 * 1517 * @since 3.0.0 1518 * 1519 * @see register_post_type() 1516 1520 * @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. 1521 1524 */ 1522 1525 function get_post_type_capabilities( $args ) { … … 1567 1570 1568 1571 /** 1569 * Store s or returnsa 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(). 1570 1573 * 1571 1574 * @since 3.1.0 1572 1575 * @access private 1576 * 1577 * @param null|array $capabilities Post type meta capabilities. 1573 1578 */ 1574 1579 function _post_type_meta_capabilities( $capabilities = null ) { … … 1583 1588 1584 1589 /** 1585 * Build san object with all post type labels out of a post type object1590 * Build an object with all post type labels out of a post type object 1586 1591 * 1587 1592 * 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 1589 1595 * - 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). 1603 1614 * 1604 1615 * @since 3.0.0 1605 1616 * @access private 1606 1617 * 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. 1609 1620 */ 1610 1621 function get_post_type_labels( $post_type_object ) { … … 1645 1656 1646 1657 /** 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 1649 1662 * @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. 1651 1666 */ 1652 1667 function _get_custom_object_labels( $object, $nohier_vs_hier_defaults ) { … … 1676 1691 1677 1692 /** 1678 * Add ssubmenus for post types.1693 * Add submenus for post types. 1679 1694 * 1680 1695 * @access private … … 1707 1722 * 1708 1723 * @param string $post_type The post type for which to add the feature. 1709 * @param string|array $feature The feature being added, acc pets an array of1724 * @param string|array $feature The feature being added, accepts an array of 1710 1725 * feature strings or a single string. 1711 1726 */ … … 1726 1741 * 1727 1742 * @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. 1730 1746 */ 1731 1747 function remove_post_type_support( $post_type, $feature ) { … … 1740 1756 * 1741 1757 * @since 3.4.0 1742 * @param string $post_type The post type1743 * @ return array1744 * /1745 1758 * 1759 * @param string $post_type The post type. 1760 * @return array Post type supports list. 1761 */ 1746 1762 function get_all_post_type_supports( $post_type ) { 1747 1763 global $_wp_post_type_features; … … 1754 1770 1755 1771 /** 1756 * Check s a post type's support for a given feature1772 * Check a post type's support for a given feature. 1757 1773 * 1758 1774 * @since 3.0.0 1759 * @param string $post_type The post type being checked1760 * @param string $ feature the feature being checked1761 * @ return boolean1762 * /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 */ 1764 1780 function post_type_supports( $post_type, $feature ) { 1765 1781 global $_wp_post_type_features; … … 1769 1785 1770 1786 /** 1771 * Update sthe post type for the post ID.1787 * Update the post type for the post ID. 1772 1788 * 1773 1789 * The page or post cache will be cleaned for the post ID. … … 1775 1791 * @since 2.5.0 1776 1792 * 1777 * @ uses $wpdb1778 * 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' to1781 * 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'. 1782 1798 * @return int Amount of rows changed. Should be 1 for success and 0 for failure. 1783 1799 */ … … 1811 1827 * 1812 1828 * @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 1815 1834 * 1816 1835 * @param array $args Optional. Overrides defaults. 1817 1836 * @return array List of posts. 1818 1837 */ 1819 function get_posts( $args = null) {1838 function get_posts( $args = null ) { 1820 1839 $defaults = array( 1821 1840 'numberposts' => 5, 'offset' => 0,
Note: See TracChangeset
for help on using the changeset viewer.