<!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>[28654] trunk/src/wp-includes: Ensure `$post_id` is documented as optional where applicable.</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/28654">28654</a></dd>
<dt>Author</dt> <dd>DrewAPicture</dd>
<dt>Date</dt> <dd>2014-06-03 04:43:47 +0000 (Tue, 03 Jun 2014)</dd>
</dl>
<h3>Log Message</h3>
<pre>Ensure `$post_id` is documented as optional where applicable.
See <a href="http://core.trac.wordpress.org/ticket/28388">#28388</a>.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunksrcwpincludescommenttemplatephp">trunk/src/wp-includes/comment-template.php</a></li>
<li><a href="#trunksrcwpincludescommentphp">trunk/src/wp-includes/comment.php</a></li>
<li><a href="#trunksrcwpincludeslinktemplatephp">trunk/src/wp-includes/link-template.php</a></li>
<li><a href="#trunksrcwpincludesposttemplatephp">trunk/src/wp-includes/post-template.php</a></li>
<li><a href="#trunksrcwpincludespostphp">trunk/src/wp-includes/post.php</a></li>
<li><a href="#trunksrcwpincludesrevisionphp">trunk/src/wp-includes/revision.php</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunksrcwpincludescommenttemplatephp"></a>
<div class="modfile"><h4>Modified: trunk/src/wp-includes/comment-template.php (28653 => 28654)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-includes/comment-template.php 2014-06-03 03:52:46 UTC (rev 28653)
+++ trunk/src/wp-includes/comment-template.php 2014-06-03 04:43:47 UTC (rev 28654)
</span><span class="lines">@@ -641,7 +641,7 @@
</span><span class="cx"> *
</span><span class="cx"> * @since 1.5.0
</span><span class="cx"> *
</span><del>- * @param int|WP_Post $post_id Post ID or WP_Post object. Default current post.
</del><ins>+ * @param int|WP_Post $post_id Optional. Post ID or WP_Post object. Default is global `$post`.
</ins><span class="cx"> * @return string The link to the comments.
</span><span class="cx"> */
</span><span class="cx"> function get_comments_link( $post_id = 0 ) {
</span></span></pre></div>
<a id="trunksrcwpincludescommentphp"></a>
<div class="modfile"><h4>Modified: trunk/src/wp-includes/comment.php (28653 => 28654)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-includes/comment.php 2014-06-03 03:52:46 UTC (rev 28653)
+++ trunk/src/wp-includes/comment.php 2014-06-03 04:43:47 UTC (rev 28654)
</span><span class="lines">@@ -2195,10 +2195,10 @@
</span><span class="cx"> *
</span><span class="cx"> * @since 1.2.0
</span><span class="cx"> *
</span><del>- * @param int $post_id Post ID. Not actually used.
</del><ins>+ * @param int $post_id Post ID.
</ins><span class="cx"> * @return int Same as Post ID from parameter
</span><span class="cx"> */
</span><del>-function generic_ping($post_id = 0) {
</del><ins>+function generic_ping( $post_id = 0 ) {
</ins><span class="cx"> $services = get_option('ping_sites');
</span><span class="cx">
</span><span class="cx"> $services = explode("\n", $services);
</span></span></pre></div>
<a id="trunksrcwpincludeslinktemplatephp"></a>
<div class="modfile"><h4>Modified: trunk/src/wp-includes/link-template.php (28653 => 28654)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-includes/link-template.php 2014-06-03 03:52:46 UTC (rev 28653)
+++ trunk/src/wp-includes/link-template.php 2014-06-03 04:43:47 UTC (rev 28654)
</span><span class="lines">@@ -290,7 +290,7 @@
</span><span class="cx"> *
</span><span class="cx"> * @since 1.0.0
</span><span class="cx"> *
</span><del>- * @param int $post_id Optional. Post ID.
</del><ins>+ * @param int|WP_Post $post_id Optional. Post ID or WP_Post object. Default is global `$post`.
</ins><span class="cx"> * @param mixed $deprecated Not used.
</span><span class="cx"> * @return string
</span><span class="cx"> */
</span></span></pre></div>
<a id="trunksrcwpincludesposttemplatephp"></a>
<div class="modfile"><h4>Modified: trunk/src/wp-includes/post-template.php (28653 => 28654)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-includes/post-template.php 2014-06-03 03:52:46 UTC (rev 28653)
+++ trunk/src/wp-includes/post-template.php 2014-06-03 04:43:47 UTC (rev 28654)
</span><span class="lines">@@ -1719,7 +1719,7 @@
</span><span class="cx"> * @uses get_edit_post_link()
</span><span class="cx"> * @uses get_the_author_meta()
</span><span class="cx"> *
</span><del>- * @param int|WP_Post $post_id Optional. Post ID or post object.
</del><ins>+ * @param int|WP_Post $post_id Optional. Post ID or WP_Post object. Default is global `$post`.
</ins><span class="cx"> * @param string $type 'all' (default), 'revision' or 'autosave'
</span><span class="cx"> * @return null
</span><span class="cx"> */
</span></span></pre></div>
<a id="trunksrcwpincludespostphp"></a>
<div class="modfile"><h4>Modified: trunk/src/wp-includes/post.php (28653 => 28654)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-includes/post.php 2014-06-03 03:52:46 UTC (rev 28653)
+++ trunk/src/wp-includes/post.php 2014-06-03 04:43:47 UTC (rev 28654)
</span><span class="lines">@@ -1857,8 +1857,8 @@
</span><span class="cx"> * @since 1.2.0
</span><span class="cx"> * @link http://codex.wordpress.org/Function_Reference/get_post_custom
</span><span class="cx"> *
</span><del>- * @param int $post_id Post ID.
- * @return array
</del><ins>+ * @param int $post_id Optional. Post ID. Default is ID of the global `$post`.
+ * @return array Post meta for the given post.
</ins><span class="cx"> */
</span><span class="cx"> function get_post_custom( $post_id = 0 ) {
</span><span class="cx"> $post_id = absint( $post_id );
</span><span class="lines">@@ -1876,7 +1876,7 @@
</span><span class="cx"> * @since 1.2.0
</span><span class="cx"> * @link http://codex.wordpress.org/Function_Reference/get_post_custom_keys
</span><span class="cx"> *
</span><del>- * @param int $post_id post ID
</del><ins>+ * @param int $post_id Optional. Post ID. Default is ID of the global `$post`.
</ins><span class="cx"> * @return array|null Either array of the keys, or null if keys could not be retrieved.
</span><span class="cx"> */
</span><span class="cx"> function get_post_custom_keys( $post_id = 0 ) {
</span><span class="lines">@@ -1899,7 +1899,7 @@
</span><span class="cx"> * @link http://codex.wordpress.org/Function_Reference/get_post_custom_values
</span><span class="cx"> *
</span><span class="cx"> * @param string $key Meta field key.
</span><del>- * @param int $post_id Post ID
</del><ins>+ * @param int $post_id Optional. Post ID. Default is ID of the global `$post`.
</ins><span class="cx"> * @return array Meta field values.
</span><span class="cx"> */
</span><span class="cx"> function get_post_custom_values( $key = '', $post_id = 0 ) {
</span><span class="lines">@@ -1919,7 +1919,7 @@
</span><span class="cx"> *
</span><span class="cx"> * @since 2.7.0
</span><span class="cx"> *
</span><del>- * @param int $post_id Optional. Post ID.
</del><ins>+ * @param int $post_id Optional. Post ID. Default is ID of the global `$post`.
</ins><span class="cx"> * @return bool Whether post is sticky.
</span><span class="cx"> */
</span><span class="cx"> function is_sticky( $post_id = 0 ) {
</span><span class="lines">@@ -2565,8 +2565,9 @@
</span><span class="cx"> *
</span><span class="cx"> * @uses wp_delete_post() if trash is disabled
</span><span class="cx"> *
</span><del>- * @param int $post_id Post ID.
- * @return mixed False on failure
</del><ins>+ * @param int $post_id Optional. Post ID. Default is ID of the global `$post`
+ * if EMPTY_TRASH_DAYS equals true.
+ * @return bool|array Post data array, otherwise false.
</ins><span class="cx"> */
</span><span class="cx"> function wp_trash_post($post_id = 0) {
</span><span class="cx"> if ( !EMPTY_TRASH_DAYS )
</span><span class="lines">@@ -2612,10 +2613,10 @@
</span><span class="cx"> *
</span><span class="cx"> * @since 2.9.0
</span><span class="cx"> *
</span><del>- * @param int $post_id Post ID.
</del><ins>+ * @param int $post_id Optional. Post ID. Default is ID of the global `$post`.
</ins><span class="cx"> * @return mixed False on failure
</span><span class="cx"> */
</span><del>-function wp_untrash_post($post_id = 0) {
</del><ins>+function wp_untrash_post( $post_id = 0 ) {
</ins><span class="cx"> if ( !$post = get_post($post_id, ARRAY_A) )
</span><span class="cx"> return $post;
</span><span class="cx">
</span><span class="lines">@@ -2776,7 +2777,7 @@
</span><span class="cx"> *
</span><span class="cx"> * @uses wp_get_object_terms() Retrieves the categories. Args details can be found here.
</span><span class="cx"> *
</span><del>- * @param int $post_id Optional. The Post ID.
</del><ins>+ * @param int $post_id Optional. The Post ID. Does not default to the global `$post`.
</ins><span class="cx"> * @param array $args Optional. Overwrite the defaults.
</span><span class="cx"> * @return array
</span><span class="cx"> */
</span><span class="lines">@@ -2801,7 +2802,7 @@
</span><span class="cx"> *
</span><span class="cx"> * @uses wp_get_object_terms() Gets the tags for returning. Args can be found here
</span><span class="cx"> *
</span><del>- * @param int $post_id Optional. The Post ID
</del><ins>+ * @param int $post_id Optional. The Post ID. Does not default to the global `$post`.
</ins><span class="cx"> * @param array $args Optional. Overwrite the defaults
</span><span class="cx"> * @return array List of post tags.
</span><span class="cx"> */
</span><span class="lines">@@ -2820,9 +2821,9 @@
</span><span class="cx"> *
</span><span class="cx"> * @uses wp_get_object_terms() Gets the tags for returning. Args can be found here
</span><span class="cx"> *
</span><del>- * @param int $post_id Optional. The Post ID
</del><ins>+ * @param int $post_id Optional. The Post ID. Does not default to the global `$post`.
</ins><span class="cx"> * @param string $taxonomy The taxonomy for which to retrieve terms. Defaults to post_tag.
</span><del>- * @param array $args Optional. Overwrite the defaults
</del><ins>+ * @param array $args Optional. {@link wp_get_object_terms()} arguments.
</ins><span class="cx"> * @return array List of post tags.
</span><span class="cx"> */
</span><span class="cx"> function wp_get_post_terms( $post_id = 0, $taxonomy = 'post_tag', $args = array() ) {
</span><span class="lines">@@ -3578,11 +3579,11 @@
</span><span class="cx"> *
</span><span class="cx"> * @since 2.3.0
</span><span class="cx"> *
</span><del>- * @param int $post_id Post ID
</del><ins>+ * @param int $post_id Optional. The Post ID. Does not default to the global `$post`.
</ins><span class="cx"> * @param string $tags The tags to set for the post, separated by commas.
</span><span class="cx"> * @return bool|null Will return false if $post_id is not an integer or is 0. Will return null otherwise
</span><span class="cx"> */
</span><del>-function wp_add_post_tags($post_id = 0, $tags = '') {
</del><ins>+function wp_add_post_tags( $post_id = 0, $tags = '' ) {
</ins><span class="cx"> return wp_set_post_tags($post_id, $tags, true);
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -3592,7 +3593,7 @@
</span><span class="cx"> * @since 2.3.0
</span><span class="cx"> * @uses wp_set_object_terms() Sets the tags for the post.
</span><span class="cx"> *
</span><del>- * @param int $post_id Post ID.
</del><ins>+ * @param int $post_id Optional. The Post ID. Does not default to the global `$post`.
</ins><span class="cx"> * @param string $tags The tags to set for the post, separated by commas.
</span><span class="cx"> * @param bool $append If true, don't delete existing tags, just add on. If false, replace the tags with the new tags.
</span><span class="cx"> * @return mixed Array of affected term IDs. WP_Error or false on failure.
</span><span class="lines">@@ -3607,10 +3608,10 @@
</span><span class="cx"> * @since 2.8.0
</span><span class="cx"> * @uses wp_set_object_terms() Sets the tags for the post.
</span><span class="cx"> *
</span><del>- * @param int $post_id Post ID.
- * @param string $tags The tags to set for the post, separated by commas.
</del><ins>+ * @param int $post_id Optional. The Post ID. Does not default to the global `$post`.
+ * @param string $tags The tags to set for the post, separated by commas.
</ins><span class="cx"> * @param string $taxonomy Taxonomy name. Defaults to 'post_tag'.
</span><del>- * @param bool $append If true, don't delete existing tags, just add on. If false, replace the tags with the new tags.
</del><ins>+ * @param bool $append If true, don't delete existing tags, just add on. If false, replace the tags with the new tags.
</ins><span class="cx"> * @return mixed Array of affected term IDs. WP_Error or false on failure.
</span><span class="cx"> */
</span><span class="cx"> function wp_set_post_terms( $post_id = 0, $tags = '', $taxonomy = 'post_tag', $append = false ) {
</span><span class="lines">@@ -3646,7 +3647,7 @@
</span><span class="cx"> *
</span><span class="cx"> * @since 2.1.0
</span><span class="cx"> *
</span><del>- * @param int $post_ID Post ID.
</del><ins>+ * @param int $post_ID Optional. The Post ID. Does not default to the global `$post`.
</ins><span class="cx"> * @param array|int $post_categories Optional. List of categories or ID of category.
</span><span class="cx"> * @param bool $append If true, don't delete existing categories, just add on. If false, replace the categories with the new categories.
</span><span class="cx"> * @return bool|mixed
</span><span class="lines">@@ -4834,7 +4835,7 @@
</span><span class="cx"> *
</span><span class="cx"> * @since 2.1.0
</span><span class="cx"> *
</span><del>- * @param int $post_id Attachment ID
</del><ins>+ * @param int $post_id Attachment ID. Default 0.
</ins><span class="cx"> * @param bool $unfiltered Optional, default is false. If true, filters are not run.
</span><span class="cx"> * @return string|bool Attachment meta field. False on failure.
</span><span class="cx"> */
</span><span class="lines">@@ -4893,7 +4894,7 @@
</span><span class="cx"> *
</span><span class="cx"> * @since 2.1.0
</span><span class="cx"> *
</span><del>- * @param int $post_id Attachment ID.
</del><ins>+ * @param int $post_id Optional. Attachment ID. Default 0.
</ins><span class="cx"> * @return string
</span><span class="cx"> */
</span><span class="cx"> function wp_get_attachment_url( $post_id = 0 ) {
</span><span class="lines">@@ -4940,7 +4941,7 @@
</span><span class="cx"> *
</span><span class="cx"> * @since 2.1.0
</span><span class="cx"> *
</span><del>- * @param int $post_id Attachment ID.
</del><ins>+ * @param int $post_id Optional. Attachment ID. Default 0.
</ins><span class="cx"> * @return mixed False on failure. Thumbnail file path on success.
</span><span class="cx"> */
</span><span class="cx"> function wp_get_attachment_thumb_file( $post_id = 0 ) {
</span><span class="lines">@@ -4971,7 +4972,7 @@
</span><span class="cx"> *
</span><span class="cx"> * @since 2.1.0
</span><span class="cx"> *
</span><del>- * @param int $post_id Attachment ID
</del><ins>+ * @param int $post_id Optional. Attachment ID. Default 0.
</ins><span class="cx"> * @return string|bool False on failure. Thumbnail URL on success.
</span><span class="cx"> */
</span><span class="cx"> function wp_get_attachment_thumb_url( $post_id = 0 ) {
</span><span class="lines">@@ -5006,8 +5007,8 @@
</span><span class="cx"> *
</span><span class="cx"> * @since 2.1.0
</span><span class="cx"> *
</span><del>- * @param int $post_id Attachment ID
- * @return bool
</del><ins>+ * @param int $post_id Optional. Attachment ID. Default 0.
+ * @return bool Whether the attachment is an image.
</ins><span class="cx"> */
</span><span class="cx"> function wp_attachment_is_image( $post_id = 0 ) {
</span><span class="cx"> $post_id = (int) $post_id;
</span></span></pre></div>
<a id="trunksrcwpincludesrevisionphp"></a>
<div class="modfile"><h4>Modified: trunk/src/wp-includes/revision.php (28653 => 28654)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-includes/revision.php 2014-06-03 03:52:46 UTC (rev 28653)
+++ trunk/src/wp-includes/revision.php 2014-06-03 04:43:47 UTC (rev 28654)
</span><span class="lines">@@ -409,7 +409,7 @@
</span><span class="cx"> *
</span><span class="cx"> * @uses get_children()
</span><span class="cx"> *
</span><del>- * @param int|object $post_id Post ID or post object
</del><ins>+ * @param int|WP_Post $post_id Optional. Post ID or WP_Post object. Default is global `$post`.
</ins><span class="cx"> * @return array An array of revisions, or an empty array if none.
</span><span class="cx"> */
</span><span class="cx"> function wp_get_post_revisions( $post_id = 0, $args = null ) {
</span></span></pre>
</div>
</div>
</body>
</html>