<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[29092] trunk/src/wp-includes/post.php: General inline documentation improvements in wp-includes/post.php.</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://core.trac.wordpress.org/changeset/29092">29092</a></dd>
<dt>Author</dt> <dd>DrewAPicture</dd>
<dt>Date</dt> <dd>2014-07-11 08:15:52 +0000 (Fri, 11 Jul 2014)</dd>
</dl>
<h3>Log Message</h3>
<pre>General inline documentation improvements in wp-includes/post.php.
Second-run. See <a href="http://core.trac.wordpress.org/ticket/25412">#25412</a>.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunksrcwpincludespostphp">trunk/src/wp-includes/post.php</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunksrcwpincludespostphp"></a>
<div class="modfile"><h4>Modified: trunk/src/wp-includes/post.php (29091 => 29092)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-includes/post.php 2014-07-11 07:55:38 UTC (rev 29091)
+++ trunk/src/wp-includes/post.php 2014-07-11 08:15:52 UTC (rev 29092)
</span><span class="lines">@@ -1276,7 +1276,7 @@
</span><span class="cx"> * @type const $ep_mask Endpoint mask to assign. If not specified and permalink_epmask is set,
</span><span class="cx"> * inherits from $permalink_epmask. If not specified and permalink_epmask
</span><span class="cx"> * is not set, defaults to EP_PERMALINK.
</span><del>- * }
</del><ins>+ * }
</ins><span class="cx"> * @type string|bool $query_var Sets the query_var key for this post type. Defaults to $post_type
</span><span class="cx"> * key. If false, a post type cannot be loaded at
</span><span class="cx"> * ?{query_var}={post_slug}. If specified as a string, the query
</span><span class="lines">@@ -1439,6 +1439,7 @@
</span><span class="cx"> add_permastruct( $post_type, "{$args->rewrite['slug']}/%$post_type%", $permastruct_args );
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+ // Register the post type meta box if a custom callback was specified.
</ins><span class="cx"> if ( $args->register_meta_box_cb )
</span><span class="cx"> add_action( 'add_meta_boxes_' . $post_type, $args->register_meta_box_cb, 10, 1 );
</span><span class="cx">
</span><span class="lines">@@ -1467,7 +1468,7 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> /**
</span><del>- * Builds an object with all post type capabilities out of a post type object
</del><ins>+ * Build an object with all post type capabilities out of a post type object
</ins><span class="cx"> *
</span><span class="cx"> * Post type capabilities use the 'capability_type' argument as a base, if the
</span><span class="cx"> * capability is not set in the 'capabilities' argument array or if the
</span><span class="lines">@@ -1513,11 +1514,13 @@
</span><span class="cx"> * only assigned by default if the post type is registered with the 'map_meta_cap'
</span><span class="cx"> * argument set to true (default is false).
</span><span class="cx"> *
</span><del>- * @see map_meta_cap()
</del><span class="cx"> * @since 3.0.0
</span><span class="cx"> *
</span><del>- * @param object $args Post type registration arguments
- * @return object object with all the capabilities as member variables
</del><ins>+ * @see register_post_type()
+ * @see map_meta_cap()
+ *
+ * @param object $args Post type registration arguments.
+ * @return object object with all the capabilities as member variables.
</ins><span class="cx"> */
</span><span class="cx"> function get_post_type_capabilities( $args ) {
</span><span class="cx"> if ( ! is_array( $args->capability_type ) )
</span><span class="lines">@@ -1566,10 +1569,12 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> /**
</span><del>- * Stores or returns a list of post type meta caps for map_meta_cap().
</del><ins>+ * Store or return a list of post type meta caps for map_meta_cap().
</ins><span class="cx"> *
</span><span class="cx"> * @since 3.1.0
</span><span class="cx"> * @access private
</span><ins>+ *
+ * @param null|array $capabilities Post type meta capabilities.
</ins><span class="cx"> */
</span><span class="cx"> function _post_type_meta_capabilities( $capabilities = null ) {
</span><span class="cx"> static $meta_caps = array();
</span><span class="lines">@@ -1582,30 +1587,36 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> /**
</span><del>- * Builds an object with all post type labels out of a post type object
</del><ins>+ * Build an object with all post type labels out of a post type object
</ins><span class="cx"> *
</span><span class="cx"> * Accepted keys of the label array in the post type object:
</span><del>- * - name - general name for the post type, usually plural. The same and overridden by $post_type_object->label. Default is Posts/Pages
</del><ins>+ * - name - general name for the post type, usually plural. The same and overridden
+ * by $post_type_object->label. Default is Posts/Pages
</ins><span class="cx"> * - singular_name - name for one object of this post type. Default is Post/Page
</span><del>- * - 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>
- * - add_new_item - Default is Add New Post/Add New Page
- * - edit_item - Default is Edit Post/Edit Page
- * - new_item - Default is New Post/New Page
- * - view_item - Default is View Post/View Page
- * - search_items - Default is Search Posts/Search Pages
- * - not_found - Default is No posts found/No pages found
- * - not_found_in_trash - Default is No posts found in Trash/No pages found in Trash
- * - parent_item_colon - This string isn't used on non-hierarchical types. In hierarchical ones the default is Parent Page:
- * - all_items - String for the submenu. Default is All Posts/All Pages
- * - menu_name - Default is the same as <code>name</code>
</del><ins>+ * - add_new - Default is Add New for both hierarchical and non-hierarchical types.
+ * When internationalizing this string, please use a gettext context
+ * {@see http://codex.wordpress.org/I18n_for_WordPress_Developers#Disambiguation_by_context}
+ * matching your post type. Example: <code>_x('Add New', 'product');</code>.
+ * - add_new_item - Default is Add New Post/Add New Page.
+ * - edit_item - Default is Edit Post/Edit Page.
+ * - new_item - Default is New Post/New Page.
+ * - view_item - Default is View Post/View Page.
+ * - search_items - Default is Search Posts/Search Pages.
+ * - not_found - Default is No posts found/No pages found.
+ * - not_found_in_trash - Default is No posts found in Trash/No pages found in Trash.
+ * - parent_item_colon - This string isn't used on non-hierarchical types. In hierarchical
+ * ones the default is 'Parent Page:'.
+ * - all_items - String for the submenu. Default is All Posts/All Pages.
+ * - menu_name - Default is the same as <code>name</code>.
</ins><span class="cx"> *
</span><del>- * Above, the first default value is for non-hierarchical post types (like posts) and the second one is for hierarchical post types (like pages).
</del><ins>+ * Above, the first default value is for non-hierarchical post types (like posts)
+ * and the second one is for hierarchical post types (like pages).
</ins><span class="cx"> *
</span><span class="cx"> * @since 3.0.0
</span><span class="cx"> * @access private
</span><span class="cx"> *
</span><del>- * @param object $post_type_object
- * @return object object with all the labels as member variables
</del><ins>+ * @param object $post_type_object Post type object.
+ * @return object object with all the labels as member variables.
</ins><span class="cx"> */
</span><span class="cx"> function get_post_type_labels( $post_type_object ) {
</span><span class="cx"> $nohier_vs_hier_defaults = array(
</span><span class="lines">@@ -1644,10 +1655,14 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> /**
</span><del>- * Builds an object with custom-something object (post type, taxonomy) labels out of a custom-something object
</del><ins>+ * Build an object with custom-something object (post type, taxonomy) labels
+ * out of a custom-something object
</ins><span class="cx"> *
</span><ins>+ * @since 3.0.0
</ins><span class="cx"> * @access private
</span><del>- * @since 3.0.0
</del><ins>+ *
+ * @param object $object A custom-something object.
+ * @param array $nohier_vs_hier_defaults Hierarchical vs non-hierarchical default labels.
</ins><span class="cx"> */
</span><span class="cx"> function _get_custom_object_labels( $object, $nohier_vs_hier_defaults ) {
</span><span class="cx"> $object->labels = (array) $object->labels;
</span><span class="lines">@@ -1675,7 +1690,7 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> /**
</span><del>- * Adds submenus for post types.
</del><ins>+ * Add submenus for post types.
</ins><span class="cx"> *
</span><span class="cx"> * @access private
</span><span class="cx"> * @since 3.1.0
</span><span class="lines">@@ -1706,7 +1721,7 @@
</span><span class="cx"> * @since 3.0.0
</span><span class="cx"> *
</span><span class="cx"> * @param string $post_type The post type for which to add the feature.
</span><del>- * @param string|array $feature The feature being added, accpets an array of
</del><ins>+ * @param string|array $feature The feature being added, accepts an array of
</ins><span class="cx"> * feature strings or a single string.
</span><span class="cx"> */
</span><span class="cx"> function add_post_type_support( $post_type, $feature ) {
</span><span class="lines">@@ -1725,8 +1740,9 @@
</span><span class="cx"> * Remove support for a feature from a post type.
</span><span class="cx"> *
</span><span class="cx"> * @since 3.0.0
</span><del>- * @param string $post_type The post type for which to remove the feature
- * @param string $feature The feature being removed
</del><ins>+ *
+ * @param string $post_type The post type for which to remove the feature.
+ * @param string $feature The feature being removed.
</ins><span class="cx"> */
</span><span class="cx"> function remove_post_type_support( $post_type, $feature ) {
</span><span class="cx"> global $_wp_post_type_features;
</span><span class="lines">@@ -1739,10 +1755,10 @@
</span><span class="cx"> * Get all the post type features
</span><span class="cx"> *
</span><span class="cx"> * @since 3.4.0
</span><del>- * @param string $post_type The post type
- * @return array
</del><ins>+ *
+ * @param string $post_type The post type.
+ * @return array Post type supports list.
</ins><span class="cx"> */
</span><del>-
</del><span class="cx"> function get_all_post_type_supports( $post_type ) {
</span><span class="cx"> global $_wp_post_type_features;
</span><span class="cx">
</span><span class="lines">@@ -1753,14 +1769,14 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> /**
</span><del>- * Checks a post type's support for a given feature
</del><ins>+ * Check a post type's support for a given feature.
</ins><span class="cx"> *
</span><span class="cx"> * @since 3.0.0
</span><del>- * @param string $post_type The post type being checked
- * @param string $feature the feature being checked
- * @return boolean
</del><ins>+ *
+ * @param string $post_type The post type being checked.
+ * @param string $feature the feature being checked.
+ * @return bool Whether the post type supports the given feature.
</ins><span class="cx"> */
</span><del>-
</del><span class="cx"> function post_type_supports( $post_type, $feature ) {
</span><span class="cx"> global $_wp_post_type_features;
</span><span class="cx">
</span><span class="lines">@@ -1768,17 +1784,17 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> /**
</span><del>- * Updates the post type for the post ID.
</del><ins>+ * Update the post type for the post ID.
</ins><span class="cx"> *
</span><span class="cx"> * The page or post cache will be cleaned for the post ID.
</span><span class="cx"> *
</span><span class="cx"> * @since 2.5.0
</span><span class="cx"> *
</span><del>- * @uses $wpdb
</del><ins>+ * @global wpdb $wpdb WordPress database access abstraction object.
</ins><span class="cx"> *
</span><del>- * @param int $post_id Post ID to change post type. Not actually optional.
- * @param string $post_type Optional, default is post. Supported values are 'post' or 'page' to
- * name a few.
</del><ins>+ * @param int $post_id Optional. Post ID to change post type. Default 0.
+ * @param string $post_type Optional. Post type. Accepts 'post' or 'page' to
+ * name a few. Default 'post'.
</ins><span class="cx"> * @return int Amount of rows changed. Should be 1 for success and 0 for failure.
</span><span class="cx"> */
</span><span class="cx"> function set_post_type( $post_id = 0, $post_type = 'post' ) {
</span><span class="lines">@@ -1810,13 +1826,16 @@
</span><span class="cx"> * 'post_status' - Default is 'publish'. Post status to retrieve.
</span><span class="cx"> *
</span><span class="cx"> * @since 1.2.0
</span><del>- * @uses WP_Query::query() See for more default arguments and information.
- * @link http://codex.wordpress.org/Template_Tags/get_posts
</del><span class="cx"> *
</span><ins>+ * @todo Tie to WP_Query default args hash notation.
+ *
+ * @see WP_Query::query() See for more default arguments and information.
+ * @see http://codex.wordpress.org/Template_Tags/get_posts
+ *
</ins><span class="cx"> * @param array $args Optional. Overrides defaults.
</span><span class="cx"> * @return array List of posts.
</span><span class="cx"> */
</span><del>-function get_posts($args = null) {
</del><ins>+function get_posts( $args = null ) {
</ins><span class="cx"> $defaults = array(
</span><span class="cx"> 'numberposts' => 5, 'offset' => 0,
</span><span class="cx"> 'category' => 0, 'orderby' => 'date',
</span></span></pre>
</div>
</div>
</body>
</html>