<!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>[29090] 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/29090">29090</a></dd>
<dt>Author</dt> <dd>DrewAPicture</dd>
<dt>Date</dt> <dd>2014-07-11 07:00:38 +0000 (Fri, 11 Jul 2014)</dd>
</dl>
<h3>Log Message</h3>
<pre>General inline documentation improvements in wp-includes/post.php.
First-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 (29089 => 29090)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-includes/post.php 2014-07-11 06:38:51 UTC (rev 29089)
+++ trunk/src/wp-includes/post.php 2014-07-11 07:00:38 UTC (rev 29090)
</span><span class="lines">@@ -180,13 +180,13 @@
</span><span class="cx"> *
</span><span class="cx"> * @since 2.0.0
</span><span class="cx"> *
</span><del>- * @param int $attachment_id Attachment ID.
- * @param bool $unfiltered Whether to apply filters.
</del><ins>+ * @param int $attachment_id Attachment ID.
+ * @param bool $unfiltered Optional. Whether to apply filters. Default false.
</ins><span class="cx"> * @return string|bool The file path to where the attached file should be, false otherwise.
</span><span class="cx"> */
</span><span class="cx"> function get_attached_file( $attachment_id, $unfiltered = false ) {
</span><span class="cx"> $file = get_post_meta( $attachment_id, '_wp_attached_file', true );
</span><del>- // If the file is relative, prepend upload dir
</del><ins>+ // If the file is relative, prepend upload dir.
</ins><span class="cx"> if ( $file && 0 !== strpos($file, '/') && !preg_match('|^.:\\\|', $file) && ( ($uploads = wp_upload_dir()) && false === $uploads['error'] ) )
</span><span class="cx"> $file = $uploads['basedir'] . "/$file";
</span><span class="cx"> if ( $unfiltered )
</span><span class="lines">@@ -211,8 +211,8 @@
</span><span class="cx"> *
</span><span class="cx"> * @since 2.1.0
</span><span class="cx"> *
</span><del>- * @param int $attachment_id Attachment ID
- * @param string $file File path for the attachment
</del><ins>+ * @param int $attachment_id Attachment ID.
+ * @param string $file File path for the attachment.
</ins><span class="cx"> * @return bool True on success, false on failure.
</span><span class="cx"> */
</span><span class="cx"> function update_attached_file( $attachment_id, $file ) {
</span><span class="lines">@@ -242,8 +242,8 @@
</span><span class="cx"> *
</span><span class="cx"> * @since 2.9.0
</span><span class="cx"> *
</span><del>- * @param string $path Full path to the file
- * @return string relative path on success, unchanged path on failure.
</del><ins>+ * @param string $path Full path to the file.
+ * @return string Relative path on success, unchanged path on failure.
</ins><span class="cx"> */
</span><span class="cx"> function _wp_relative_upload_path( $path ) {
</span><span class="cx"> $new_path = $path;
</span><span class="lines">@@ -304,17 +304,18 @@
</span><span class="cx"> * post types are 'post', 'pages', and 'attachments'. The 'post_status'
</span><span class="cx"> * argument will accept any post status within the write administration panels.
</span><span class="cx"> *
</span><del>- * @see get_posts() Has additional arguments that can be replaced.
</del><span class="cx"> * @internal Claims made in the long description might be inaccurate.
</span><del>- *
</del><span class="cx"> * @since 2.0.0
</span><span class="cx"> *
</span><del>- * @param mixed $args Optional. User defined arguments for replacing the defaults.
- * @param string $output Optional. Constant for return type, either OBJECT (default), ARRAY_A, ARRAY_N.
</del><ins>+ * @see get_posts() Has additional arguments that can be replaced.
+ *
+ * @param mixed $args Optional. User defined arguments for replacing the defaults. Default empty.
+ * @param string $output Optional. Constant for return type. Accepts OBJECT, ARRAY_A, ARRAY_N.
+ * Default OBJECt.
</ins><span class="cx"> * @return array Array of children, where the type of each element is determined by $output parameter.
</span><span class="cx"> * Empty array on failure.
</span><span class="cx"> */
</span><del>-function get_children($args = '', $output = OBJECT) {
</del><ins>+function get_children( $args = '', $output = OBJECT ) {
</ins><span class="cx"> $kids = array();
</span><span class="cx"> if ( empty( $args ) ) {
</span><span class="cx"> if ( isset( $GLOBALS['post'] ) ) {
</span><span class="lines">@@ -379,8 +380,8 @@
</span><span class="cx"> * @param string $post Post content.
</span><span class="cx"> * @return array Post before ('main'), after ('extended'), and custom readmore ('more_text').
</span><span class="cx"> */
</span><del>-function get_extended($post) {
- //Match the new style more links
</del><ins>+function get_extended( $post ) {
+ //Match the new style more links.
</ins><span class="cx"> if ( preg_match('/<!--more(.*?)?-->/', $post, $matches) ) {
</span><span class="cx"> list($main, $extended) = explode($matches[0], $post, 2);
</span><span class="cx"> $more_text = $matches[1];
</span><span class="lines">@@ -405,12 +406,15 @@
</span><span class="cx"> * $post, must be given as a variable, since it is passed by reference.
</span><span class="cx"> *
</span><span class="cx"> * @since 1.5.1
</span><del>- * @link http://codex.wordpress.org/Function_Reference/get_post
</del><span class="cx"> *
</span><del>- * @param int|WP_Post $post Optional. Post ID or post object.
- * @param string $output Optional, default is Object. Either OBJECT, ARRAY_A, or ARRAY_N.
- * @param string $filter Optional, default is raw.
- * @return WP_Post|null WP_Post on success or null on failure
</del><ins>+ * @see http://codex.wordpress.org/Function_Reference/get_post
+ *
+ * @param int|WP_Post $post Optional. Post ID or post object. Defaults to global $post.
+ * @param string $output Optional, default is Object. Accepts OBJECT, ARRAY_A, or ARRAY_N.
+ * Default OBJECT.
+ * @param string $filter Optional. Type of filter to apply. Accepts 'raw', 'edit', 'db',
+ * or 'display'. Default 'raw'.
+ * @return WP_Post|null WP_Post on success or null on failure.
</ins><span class="cx"> */
</span><span class="cx"> function get_post( $post = null, $output = OBJECT, $filter = 'raw' ) {
</span><span class="cx"> if ( empty( $post ) && isset( $GLOBALS['post'] ) )
</span><span class="lines">@@ -627,6 +631,15 @@
</span><span class="cx"> */
</span><span class="cx"> public $filter;
</span><span class="cx">
</span><ins>+ /**
+ * Retrieve WP_Post instance.
+ *
+ * @static
+ * @access public
+ *
+ * @param int $post_id Post ID.
+ * @return WP_Post|bool Post object, false otherwise.
+ */
</ins><span class="cx"> public static function get_instance( $post_id ) {
</span><span class="cx"> global $wpdb;
</span><span class="cx">
</span><span class="lines">@@ -651,11 +664,22 @@
</span><span class="cx"> return new WP_Post( $_post );
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+ /**
+ * Constructor.
+ *
+ * @param WP_Post $post Post object.
+ */
</ins><span class="cx"> public function __construct( $post ) {
</span><span class="cx"> foreach ( get_object_vars( $post ) as $key => $value )
</span><span class="cx"> $this->$key = $value;
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+ /**
+ * Isset-er.
+ *
+ * @param string $key Property to check if set.
+ * @return bool
+ */
</ins><span class="cx"> public function __isset( $key ) {
</span><span class="cx"> if ( 'ancestors' == $key )
</span><span class="cx"> return true;
</span><span class="lines">@@ -672,6 +696,12 @@
</span><span class="cx"> return metadata_exists( 'post', $this->ID, $key );
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+ /**
+ * Getter.
+ *
+ * @param string $key Key to get.
+ * @return array|mixed
+ */
</ins><span class="cx"> public function __get( $key ) {
</span><span class="cx"> if ( 'page_template' == $key && $this->__isset( $key ) ) {
</span><span class="cx"> return get_post_meta( $this->ID, '_wp_page_template', true );
</span><span class="lines">@@ -697,8 +727,7 @@
</span><span class="cx"> return wp_list_pluck( $terms, 'name' );
</span><span class="cx"> }
</span><span class="cx">
</span><del>- // Rest of the values need filtering
-
</del><ins>+ // Rest of the values need filtering.
</ins><span class="cx"> if ( 'ancestors' == $key )
</span><span class="cx"> $value = get_post_ancestors( $this );
</span><span class="cx"> else
</span><span class="lines">@@ -710,6 +739,12 @@
</span><span class="cx"> return $value;
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+ /**
+ * {@Missing Summary}
+ *
+ * @param string $filter Filter.
+ * @return $this|array|bool|object|WP_Post
+ */
</ins><span class="cx"> public function filter( $filter ) {
</span><span class="cx"> if ( $this->filter == $filter )
</span><span class="cx"> return $this;
</span><span class="lines">@@ -720,6 +755,11 @@
</span><span class="cx"> return sanitize_post( $this, $filter );
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+ /**
+ * Convert object to array.
+ *
+ * @return array Object as array.
+ */
</ins><span class="cx"> public function to_array() {
</span><span class="cx"> $post = get_object_vars( $this );
</span><span class="cx">
</span><span class="lines">@@ -771,11 +811,13 @@
</span><span class="cx"> * supported values are found within those functions.
</span><span class="cx"> *
</span><span class="cx"> * @since 2.3.0
</span><del>- * @uses sanitize_post_field() See for possible $context values.
</del><span class="cx"> *
</span><del>- * @param string $field Post field name.
- * @param int|WP_Post $post Post ID or post object.
- * @param string $context Optional. How to filter the field. Default is 'display'.
</del><ins>+ * @see sanitize_post_field()
+ *
+ * @param string $field Post field name.
+ * @param int|WP_Post $post Post ID or post object.
+ * @param string $context Optional. How to filter the field. Accepts 'raw', 'edit', 'db',
+ * or 'display'. Default 'display'.
</ins><span class="cx"> * @return string The value of the post field on success, empty string on failure.
</span><span class="cx"> */
</span><span class="cx"> function get_post_field( $field, $post, $context = 'display' ) {
</span><span class="lines">@@ -798,10 +840,10 @@
</span><span class="cx"> *
</span><span class="cx"> * @since 2.0.0
</span><span class="cx"> *
</span><del>- * @param int|WP_Post $ID Optional. Post ID or post object.
</del><ins>+ * @param int|WP_Post $ID Optional. Post ID or post object. Default empty.
</ins><span class="cx"> * @return string|bool The mime type on success, false on failure.
</span><span class="cx"> */
</span><del>-function get_post_mime_type($ID = '') {
</del><ins>+function get_post_mime_type( $ID = '' ) {
</ins><span class="cx"> $post = get_post($ID);
</span><span class="cx">
</span><span class="cx"> if ( is_object($post) )
</span><span class="lines">@@ -818,10 +860,10 @@
</span><span class="cx"> *
</span><span class="cx"> * @since 2.0.0
</span><span class="cx"> *
</span><del>- * @param int|WP_Post $ID Optional. Post ID or post object.
</del><ins>+ * @param int|WP_Post $ID Optional. Post ID or post object. Default empty.
</ins><span class="cx"> * @return string|bool Post status on success, false on failure.
</span><span class="cx"> */
</span><del>-function get_post_status($ID = '') {
</del><ins>+function get_post_status( $ID = '' ) {
</ins><span class="cx"> $post = get_post($ID);
</span><span class="cx">
</span><span class="cx"> if ( !is_object($post) )
</span><span class="lines">@@ -862,10 +904,10 @@
</span><span class="cx"> */
</span><span class="cx"> function get_post_statuses() {
</span><span class="cx"> $status = array(
</span><del>- 'draft' => __('Draft'),
- 'pending' => __('Pending Review'),
- 'private' => __('Private'),
- 'publish' => __('Published')
</del><ins>+ 'draft' => __( 'Draft' ),
+ 'pending' => __( 'Pending Review' ),
+ 'private' => __( 'Private' ),
+ 'publish' => __( 'Published' )
</ins><span class="cx"> );
</span><span class="cx">
</span><span class="cx"> return $status;
</span><span class="lines">@@ -883,9 +925,9 @@
</span><span class="cx"> */
</span><span class="cx"> function get_page_statuses() {
</span><span class="cx"> $status = array(
</span><del>- 'draft' => __('Draft'),
- 'private' => __('Private'),
- 'publish' => __('Published')
</del><ins>+ 'draft' => __( 'Draft' ),
+ 'private' => __( 'Private' ),
+ 'publish' => __( 'Published' )
</ins><span class="cx"> );
</span><span class="cx">
</span><span class="cx"> return $status;
</span><span class="lines">@@ -898,25 +940,42 @@
</span><span class="cx"> * parameters given. The function will accept an array (second optional
</span><span class="cx"> * parameter), along with a string for the post status name.
</span><span class="cx"> *
</span><del>- *
- * Optional $args contents:
- *
- * label - A descriptive name for the post status marked for translation. Defaults to $post_status.
- * public - Whether posts of this status should be shown in the front end of the site. Defaults to true.
- * exclude_from_search - Whether to exclude posts with this post status from search results. Defaults to false.
- * show_in_admin_all_list - Whether to include posts in the edit listing for their post type
- * show_in_admin_status_list - Show in the list of statuses with post counts at the top of the edit
- * listings, e.g. All (12) | Published (9) | My Custom Status (2) ...
- *
</del><span class="cx"> * Arguments prefixed with an _underscore shouldn't be used by plugins and themes.
</span><span class="cx"> *
</span><span class="cx"> * @since 3.0.0
</span><span class="cx"> * @uses $wp_post_statuses Inserts new post status object into the list
</span><span class="cx"> *
</span><span class="cx"> * @param string $post_status Name of the post status.
</span><del>- * @param array|string $args See above description.
</del><ins>+ * @param array|string $args {
+ * Optional. Array or string of post status arguments.
+ *
+ * @type bool|string $label A descriptive name for the post status marked
+ * for translation. Defaults to value of $post_status.
+ * @type bool|array $label_count Descriptive text to use for nooped plurals.
+ * Default array of $label, twice
+ * @type bool $exclude_from_search Whether to exclude posts with this post status
+ * from search results. Default is value of $internal.
+ * @type bool $_builtin Whether the status is built-in. Core-use only.
+ * Default false.
+ * @type bool $public Whether posts of this status should be shown
+ * in the front end of the site. Default true.
+ * @type bool $internal Whether the status is for internal use only.
+ * Default false.
+ * @type bool $protected Whether posts with this status should be protected.
+ * Default false.
+ * @type bool $private Whether posts with this status should be private.
+ * Default false.
+ * @type bool $publicly_queryable Whether posts with this status should be publicly-
+ * queryable. Default is value of $public.
+ * @type bool $show_in_admin_all_list Whether to include posts in the edit listing for
+ * their post type. Default is value of $internal.
+ * @type bool $show_in_admin_status_list Show in the list of statuses with post counts at
+ * the top of the edit listings,
+ * e.g. All (12) | Published (9) | My Custom Status (2)
+ * Default is value of $internal.
+ * }
</ins><span class="cx"> */
</span><del>-function register_post_status($post_status, $args = array()) {
</del><ins>+function register_post_status( $post_status, $args = array() ) {
</ins><span class="cx"> global $wp_post_statuses;
</span><span class="cx">
</span><span class="cx"> if (!is_array($wp_post_statuses))
</span><span class="lines">@@ -942,6 +1001,7 @@
</span><span class="cx"> $post_status = sanitize_key($post_status);
</span><span class="cx"> $args->name = $post_status;
</span><span class="cx">
</span><ins>+ // Set various defaults.
</ins><span class="cx"> if ( null === $args->public && null === $args->internal && null === $args->protected && null === $args->private )
</span><span class="cx"> $args->internal = true;
</span><span class="cx">
</span><span class="lines">@@ -981,15 +1041,16 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> /**
</span><del>- * Retrieve a post status object by name
</del><ins>+ * Retrieve a post status object by name.
</ins><span class="cx"> *
</span><span class="cx"> * @since 3.0.0
</span><del>- * @uses $wp_post_statuses
- * @see register_post_status
- * @see get_post_statuses
</del><span class="cx"> *
</span><del>- * @param string $post_status The name of a registered post status
- * @return object A post status object
</del><ins>+ * @global array $wp_post_statuses List of post statuses.
+ *
+ * @see register_post_status()
+ *
+ * @param string $post_status The name of a registered post status.
+ * @return object A post status object.
</ins><span class="cx"> */
</span><span class="cx"> function get_post_status_object( $post_status ) {
</span><span class="cx"> global $wp_post_statuses;
</span><span class="lines">@@ -1004,15 +1065,18 @@
</span><span class="cx"> * Get a list of all registered post status objects.
</span><span class="cx"> *
</span><span class="cx"> * @since 3.0.0
</span><del>- * @uses $wp_post_statuses
- * @see register_post_status
- * @see get_post_status_object
</del><span class="cx"> *
</span><del>- * @param array|string $args An array of key => value arguments to match against the post status objects.
- * @param string $output The type of output to return, either post status 'names' or 'objects'. 'names' is the default.
- * @param string $operator The logical operation to perform. 'or' means only one element
- * from the array needs to match; 'and' means all elements must match. The default is 'and'.
- * @return array A list of post status names or objects
</del><ins>+ * @global array $wp_post_statuses List of post statuses.
+ *
+ * @see register_post_status()
+ *
+ * @param array|string $args Optional. Array or string of post status arguments. Default array.
+ * @param string $output Optional. The type of output to return. Accepts post status 'names'
+ * or 'objects'. Default 'names'.
+ * @param string $operator Optional. The logical operation to perform. 'or' means only one element
+ * from the array needs to match; 'and' means all elements must match.
+ * Default 'and'.
+ * @return array A list of post status names or objects.
</ins><span class="cx"> */
</span><span class="cx"> function get_post_stati( $args = array(), $output = 'names', $operator = 'and' ) {
</span><span class="cx"> global $wp_post_statuses;
</span><span class="lines">@@ -1028,8 +1092,9 @@
</span><span class="cx"> * A false return value might also mean that the post type does not exist.
</span><span class="cx"> *
</span><span class="cx"> * @since 3.0.0
</span><del>- * @see get_post_type_object
</del><span class="cx"> *
</span><ins>+ * @see get_post_type_object()
+ *
</ins><span class="cx"> * @param string $post_type Post type name
</span><span class="cx"> * @return bool Whether post type is hierarchical.
</span><span class="cx"> */
</span><span class="lines">@@ -1042,12 +1107,13 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> /**
</span><del>- * Checks if a post type is registered.
</del><ins>+ * Check if a post type is registered.
</ins><span class="cx"> *
</span><span class="cx"> * @since 3.0.0
</span><del>- * @uses get_post_type_object()
</del><span class="cx"> *
</span><del>- * @param string $post_type Post type name
</del><ins>+ * @see get_post_type_object()
+ *
+ * @param string $post_type Post type name.
</ins><span class="cx"> * @return bool Whether post type is registered.
</span><span class="cx"> */
</span><span class="cx"> function post_type_exists( $post_type ) {
</span><span class="lines">@@ -1059,7 +1125,7 @@
</span><span class="cx"> *
</span><span class="cx"> * @since 2.1.0
</span><span class="cx"> *
</span><del>- * @param int|WP_Post $post Optional. Post ID or post object.
</del><ins>+ * @param int|WP_Post $post Optional. Post ID or post object. Default is global $post.
</ins><span class="cx"> * @return string|bool Post type on success, false on failure.
</span><span class="cx"> */
</span><span class="cx"> function get_post_type( $post = null ) {
</span><span class="lines">@@ -1070,15 +1136,16 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> /**
</span><del>- * Retrieve a post type object by name
</del><ins>+ * Retrieve a post type object by name.
</ins><span class="cx"> *
</span><span class="cx"> * @since 3.0.0
</span><del>- * @uses $wp_post_types
- * @see register_post_type
- * @see get_post_types
</del><span class="cx"> *
</span><del>- * @param string $post_type The name of a registered post type
- * @return object A post type object
</del><ins>+ * @global array $wp_post_types List of post types.
+ *
+ * @see register_post_type()
+ *
+ * @param string $post_type The name of a registered post type.
+ * @return object A post type object.
</ins><span class="cx"> */
</span><span class="cx"> function get_post_type_object( $post_type ) {
</span><span class="cx"> global $wp_post_types;
</span><span class="lines">@@ -1093,14 +1160,19 @@
</span><span class="cx"> * Get a list of all registered post type objects.
</span><span class="cx"> *
</span><span class="cx"> * @since 2.9.0
</span><del>- * @uses $wp_post_types
- * @see register_post_type
</del><span class="cx"> *
</span><del>- * @param array|string $args An array of key => value arguments to match against the post type objects.
- * @param string $output The type of output to return, either post type 'names' or 'objects'. 'names' is the default.
- * @param string $operator The logical operation to perform. 'or' means only one element
- * from the array needs to match; 'and' means all elements must match. The default is 'and'.
- * @return array A list of post type names or objects
</del><ins>+ * @global array $wp_post_types List of post types.
+ *
+ * @see register_post_type()
+ *
+ * @param array|string $args Optional. An array of key => value arguments to match against
+ * the post type objects. Default empty array.
+ * @param string $output Optional. The type of output to return. Accepts post type 'names'
+ * or 'objects'. Default 'names'.
+ * @param string $operator Optaionl. The logical operation to perform. 'or' means only one
+ * element from the array needs to match; 'and' means all elements
+ * must match. Default 'and'.
+ * @return array A list of post type names or objects.
</ins><span class="cx"> */
</span><span class="cx"> function get_post_types( $args = array(), $output = 'names', $operator = 'and' ) {
</span><span class="cx"> global $wp_post_types;
</span></span></pre>
</div>
</div>
</body>
</html>