<!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>[23935] trunk/wp-includes/post-formats.php: PHPDoc fixes and additions for post formats.</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, #logmsg > ol { margin-left: 0; 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/23935">23935</a></dd>
<dt>Author</dt> <dd>SergeyBiryukov</dd>
<dt>Date</dt> <dd>2013-04-09 09:38:25 +0000 (Tue, 09 Apr 2013)</dd>
</dl>
<h3>Log Message</h3>
<pre>PHPDoc fixes and additions for post formats. props c3mdigital, DrewAPicture. fixes <a href="http://core.trac.wordpress.org/ticket/23974">#23974</a>.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkwpincludespostformatsphp">trunk/wp-includes/post-formats.php</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkwpincludespostformatsphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/post-formats.php (23934 => 23935)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/post-formats.php        2013-04-08 23:38:48 UTC (rev 23934)
+++ trunk/wp-includes/post-formats.php        2013-04-09 09:38:25 UTC (rev 23935)
</span><span class="lines">@@ -11,7 +11,7 @@
</span><span class="cx"> *
</span><span class="cx"> * @since 3.1.0
</span><span class="cx"> *
</span><del>- * @param int|object $post A post
</del><ins>+ * @param int|object $post A post.
</ins><span class="cx"> *
</span><span class="cx"> * @return mixed The format if successful. False if no format is set. WP_Error if errors.
</span><span class="cx"> */
</span><span class="lines">@@ -35,10 +35,11 @@
</span><span class="cx"> * Check if a post has a particular format
</span><span class="cx"> *
</span><span class="cx"> * @since 3.1.0
</span><ins>+ *
</ins><span class="cx"> * @uses has_term()
</span><span class="cx"> *
</span><del>- * @param string $format The format to check for
- * @param object|id $post The post to check. If not supplied, defaults to the current post if used in the loop.
</del><ins>+ * @param string $format The format to check for.
+ * @param object|int $post The post to check. If not supplied, defaults to the current post if used in the loop.
</ins><span class="cx"> * @return bool True if the post has the format, false otherwise.
</span><span class="cx"> */
</span><span class="cx"> function has_post_format( $format, $post = null ) {
</span><span class="lines">@@ -50,8 +51,8 @@
</span><span class="cx"> *
</span><span class="cx"> * @since 3.1.0
</span><span class="cx"> *
</span><del>- * @param int|object $post The post for which to assign a format
- * @param string $format A format to assign. Use an empty string or array to remove all formats from the post.
</del><ins>+ * @param int|object $post The post for which to assign a format.
+ * @param string $format A format to assign. Use an empty string or array to remove all formats from the post.
</ins><span class="cx"> * @return mixed WP_Error on error. Array of affected term IDs on success.
</span><span class="cx"> */
</span><span class="cx"> function set_post_format( $post, $format ) {
</span><span class="lines">@@ -76,8 +77,8 @@
</span><span class="cx"> *
</span><span class="cx"> * @since 3.6.0
</span><span class="cx"> *
</span><del>- * @param int $post_id
- * @return null
</del><ins>+ * @param int $post_id (optional) The post ID.
+ * @return array The array of post format metadata.
</ins><span class="cx"> */
</span><span class="cx"> function get_post_format_meta( $post_id = 0 ) {
</span><span class="cx">         $values = array(
</span><span class="lines">@@ -101,7 +102,7 @@
</span><span class="cx"> *
</span><span class="cx"> * @since 3.1.0
</span><span class="cx"> *
</span><del>- * @return array The array of translations
</del><ins>+ * @return array The array of translated post format names.
</ins><span class="cx"> */
</span><span class="cx"> function get_post_format_strings() {
</span><span class="cx">         $strings = array(
</span><span class="lines">@@ -124,6 +125,8 @@
</span><span class="cx"> *
</span><span class="cx"> * @since 3.1.0
</span><span class="cx"> *
</span><ins>+ * @uses get_post_format_strings()
+ *
</ins><span class="cx"> * @return array The array of post format slugs.
</span><span class="cx"> */
</span><span class="cx"> function get_post_format_slugs() {
</span><span class="lines">@@ -136,8 +139,10 @@
</span><span class="cx"> *
</span><span class="cx"> * @since 3.1.0
</span><span class="cx"> *
</span><del>- * @param string $slug A post format slug
- * @return string The translated post format name
</del><ins>+ * @uses get_post_format_strings()
+ *
+ * @param string $slug A post format slug.
+ * @return string The translated post format name.
</ins><span class="cx"> */
</span><span class="cx"> function get_post_format_string( $slug ) {
</span><span class="cx">         $strings = get_post_format_strings();
</span><span class="lines">@@ -152,8 +157,8 @@
</span><span class="cx"> *
</span><span class="cx"> * @since 3.1.0
</span><span class="cx"> *
</span><del>- * @param string $format Post format
- * @return string Link
</del><ins>+ * @param string $format The post format slug.
+ * @return string The post format term link.
</ins><span class="cx"> */
</span><span class="cx"> function get_post_format_link( $format ) {
</span><span class="cx">         $term = get_term_by('slug', 'post-format-' . $format, 'post_format' );
</span><span class="lines">@@ -259,18 +264,19 @@
</span><span class="cx"> *
</span><span class="cx"> * @since 3.6.0
</span><span class="cx"> *
</span><del>- * @param string $format
</del><ins>+ * @param string $format The post format slug, such as status, quote, image, gallery, etc.
+ * @return string Filtered post format content class.
</ins><span class="cx"> */
</span><span class="cx"> function get_post_format_content_class( $format ) {
</span><span class="cx">         return apply_filters( 'post_format_content_class', 'post-format-content', $format );
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> /**
</span><del>- * Ouput the class for a post format content wrapper
</del><ins>+ * Output the class for a post format content wrapper
</ins><span class="cx"> *
</span><span class="cx"> * @since 3.6.0
</span><span class="cx"> *
</span><del>- * @param string $format
</del><ins>+ * @param string $format The post format slug, such as status, quote, image, gallery, etc.
</ins><span class="cx"> */
</span><span class="cx"> function post_format_content_class( $format ) {
</span><span class="cx">         echo get_post_format_content_class( $format );
</span><span class="lines">@@ -281,7 +287,11 @@
</span><span class="cx"> *
</span><span class="cx"> * @since 3.6.0
</span><span class="cx"> *
</span><del>- * @param string $content
</del><ins>+ * @uses get_post_format_meta()
+ *
+ * @param string $content The post content.
+ * @param int $id (optional) The post ID.
+ * @return string Formatted output based on associated post format.
</ins><span class="cx"> */
</span><span class="cx"> function post_formats_compat( $content, $id = 0 ) {
</span><span class="cx">         $post = empty( $id ) ? get_post() : get_post( $id );
</span><span class="lines">@@ -422,6 +432,7 @@
</span><span class="cx"> * @since 3.6.0
</span><span class="cx"> *
</span><span class="cx"> * @global array $_wp_chat_parsers
</span><ins>+ *
</ins><span class="cx"> * @param string $name Unique identifier for chat format. Example: IRC
</span><span class="cx"> * @param string $newline_regex RegEx to match the start of a new line, typically when a new "username:" appears
</span><span class="cx"> *        The parser will handle up to 3 matched expressions
</span><span class="lines">@@ -451,8 +462,6 @@
</span><span class="cx"> * If the content does not contain username syntax, assume that it does not contain
</span><span class="cx"> * chat logs and return
</span><span class="cx"> *
</span><del>- * @since 3.6.0
- *
</del><span class="cx"> * Example:
</span><span class="cx"> *
</span><span class="cx"> * One stanza of chat:
</span><span class="lines">@@ -473,7 +482,10 @@
</span><span class="cx"> * )
</span><span class="cx"> * )
</span><span class="cx"> * )
</span><del>- * @param string $content A string which might contain chat data.
</del><ins>+ *
+ * @since 3.6.0
+ *
+ * @param string $content A string which might contain chat data, passed by reference.
</ins><span class="cx"> * @param boolean $remove Whether to remove the found data from the passed content.
</span><span class="cx"> * @return array A chat log as structured data
</span><span class="cx"> */
</span><span class="lines">@@ -571,8 +583,8 @@
</span><span class="cx"> *
</span><span class="cx"> * @since 3.6.0
</span><span class="cx"> *
</span><del>- * @param int $id Optional. Post ID
- * @return array
</del><ins>+ * @param int $id (optional) The post ID.
+ * @return array The chat content.
</ins><span class="cx"> */
</span><span class="cx"> function get_the_post_format_chat( $id = 0 ) {
</span><span class="cx">         $post = empty( $id ) ? clone get_post() : get_post( $id );
</span><span class="lines">@@ -629,7 +641,7 @@
</span><span class="cx"> *
</span><span class="cx"> * @since 3.6.0
</span><span class="cx"> *
</span><del>- * @param string $content A string which might contain a URL.
</del><ins>+ * @param string $content A string which might contain a URL, passed by reference.
</ins><span class="cx"> * @param boolean $remove Whether to remove the found URL from the passed content.
</span><span class="cx"> * @return string The found URL.
</span><span class="cx"> */
</span><span class="lines">@@ -670,7 +682,7 @@
</span><span class="cx"> *
</span><span class="cx"> * @since 3.6.0
</span><span class="cx"> *
</span><del>- * @param int $id Optional. Post ID.
</del><ins>+ * @param int $id (optional) The post ID.
</ins><span class="cx"> * @return string A URL, if found.
</span><span class="cx"> */
</span><span class="cx"> function get_the_post_format_url( $id = 0 ) {
</span><span class="lines">@@ -707,7 +719,7 @@
</span><span class="cx"> *
</span><span class="cx"> * @param string $more_link_text Optional. Content for when there is more text.
</span><span class="cx"> * @param bool $strip_teaser Optional. Strip teaser content before the more text. Default is false.
</span><del>- * @return string
</del><ins>+ * @return string The content minus the extracted post format content.
</ins><span class="cx"> */
</span><span class="cx"> function get_the_remaining_content( $more_link_text = null, $strip_teaser = false ) {
</span><span class="cx">         global $more, $page, $format_pages, $multipage, $preview;
</span></span></pre>
</div>
</div>
</body>
</html>