<!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>[27291] trunk/src/wp-includes/link-template.php: Add inline documentation for properties and other inline docs fixes for `WP_Adjacent_Post`.</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/27291">27291</a></dd>
<dt>Author</dt> <dd>DrewAPicture</dd>
<dt>Date</dt> <dd>2014-02-26 18:15:03 +0000 (Wed, 26 Feb 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>Add inline documentation for properties and other inline docs fixes for `WP_Adjacent_Post`.

See <a href="http://core.trac.wordpress.org/ticket/26937">#26937</a>.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunksrcwpincludeslinktemplatephp">trunk/src/wp-includes/link-template.php</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunksrcwpincludeslinktemplatephp"></a>
<div class="modfile"><h4>Modified: trunk/src/wp-includes/link-template.php (27290 => 27291)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-includes/link-template.php  2014-02-26 18:11:36 UTC (rev 27290)
+++ trunk/src/wp-includes/link-template.php     2014-02-26 18:15:03 UTC (rev 27291)
</span><span class="lines">@@ -1148,16 +1148,61 @@
</span><span class="cx">  * WordPress Adjacent Post API
</span><span class="cx">  *
</span><span class="cx">  * Based on the current or specified post, determines either the previous or
</span><del>- * next post based on the criteria specified. Supports retrieving posts with the
- * same taxonomy terms and posts that lack specific terms.
</del><ins>+ * next post based on the criteria specified. Supports retrieving posts with
+ * the same taxonomy terms and posts that lack specific terms.
+ *
+ * @since 3.9.0
+ *
+ * @package WordPress
+ * @subpackage Template
</ins><span class="cx">  */
</span><span class="cx"> class WP_Adjacent_Post {
</span><ins>+
+       /**
+        * Adjacent post object.
+        *
+        * @since 3.9.0
+        * @access public
+        * @var null|WP_Adjacent_Post
+        */
</ins><span class="cx">   public $adjacent_post = null;
</span><span class="cx"> 
</span><ins>+       /**
+        * Current post object.
+        *
+        * @since 3.9.0
+        * @access protected
+        * @var bool|WP_Post
+        */
</ins><span class="cx">   protected $current_post   = false;
</span><ins>+
+       /**
+        * 'previous' or 'next' type of adjacent post.
+        *
+        * @since 3.9.0
+        * @access protected
+        * @var string
+        */
</ins><span class="cx">   protected $adjacent       = 'previous';
</span><ins>+
</ins><span class="cx">   protected $taxonomy       = 'category';
</span><ins>+
+       /**
+        * Whether the post should be in a same taxonomy term.
+        *
+        * @since 3.9.0
+        * @access protected
+        * @var string
+        */
</ins><span class="cx">   protected $in_same_term   = false;
</span><ins>+
+       /**
+        * Excluded term IDs.
+        *
+        * @since 3.9.0
+        * @access protected
+        * @var string|array
+        */
</ins><span class="cx">   protected $excluded_terms = '';
</span><span class="cx"> 
</span><span class="cx">  /**
</span><span class="lines">@@ -1179,7 +1224,7 @@
</span><span class="cx">  /**
</span><span class="cx">   * Allow direct access to adjacent post from the class instance itself
</span><span class="cx">   *
</span><del>-        * @param string $property
</del><ins>+         * @param string $property Property to get.
</ins><span class="cx">    * @return mixed String when adjacent post is found and post property exists. Null when no adjacent post is found.
</span><span class="cx">   */
</span><span class="cx">  public function __get( $property ) {
</span><span class="lines">@@ -1312,26 +1357,29 @@
</span><span class="cx">   * Apply the deprecated filters to WP_Query's clauses.
</span><span class="cx">   *
</span><span class="cx">   * @param array $clauses
</span><del>-        * @uses $this->filter_join_and_where()
-        * @uses $this->filter_sort()
-        * @filter post_clauses
</del><span class="cx">    * @return array
</span><span class="cx">   */
</span><span class="cx">  public function filter( $clauses ) {
</span><del>-               // Immediately deregister these legacy filters to avoid modifying
-               // any calls to WP_Query from filter callbacks hooked to WP_Query filters.
</del><ins>+                /*
+                * Immediately deregister these legacy filters to avoid modifying
+                * any calls to WP_Query from filter callbacks hooked to WP_Query filters.
+                */
</ins><span class="cx">           remove_filter( 'posts_clauses', array( $this, 'filter' ) );
</span><span class="cx"> 
</span><del>-               // The `join` and `where` filters are identical in their parameters,
-               // so we can use the same approach for both.
</del><ins>+                /*
+                * The `join` and `where` filters are identical in their parameters,
+                * so we can use the same approach for both.
+                */
</ins><span class="cx">           foreach ( array( 'join', 'where' ) as $clause ) {
</span><span class="cx">                  if ( has_filter( 'get_' . $this->adjacent . '_post_' . $clause ) ) {
</span><span class="cx">                          $clauses[ $clause ] = $this->filter_join_and_where( $clauses[ $clause ], $clause );
</span><span class="cx">                  }
</span><span class="cx">          }
</span><span class="cx"> 
</span><del>-               // The legacy `sort` filter combined the ORDER BY and LIMIT clauses,
-               // while `WP_Query` does not, which requires special handling.
</del><ins>+                /*
+                * The legacy `sort` filter combined the ORDER BY and LIMIT clauses,
+                * while `WP_Query` does not, which requires special handling.
+                */
</ins><span class="cx">           if ( has_filter( 'get_' . $this->adjacent . '_post_sort' ) ) {
</span><span class="cx">                  $sort_clauses = $this->filter_sort( $clauses['orderby'], $clauses['limits'] );
</span><span class="cx">                  $clauses      = array_merge( $clauses, $sort_clauses );
</span><span class="lines">@@ -1349,6 +1397,7 @@
</span><span class="cx">   */
</span><span class="cx">  protected function filter_join_and_where( $value, $clause ) {
</span><span class="cx">          /**
</span><ins>+                * @todo Minimal hook docs
</ins><span class="cx">            * @deprecated 3.9.0
</span><span class="cx">           */
</span><span class="cx">          return apply_filters( 'get_' . $this->adjacent . '_post_' . $clause, $value, $this->in_same_term, $this->excluded_terms );
</span><span class="lines">@@ -1377,8 +1426,11 @@
</span><span class="cx"> 
</span><span class="cx">          // Split the string of one or two clauses into their respective array keys
</span><span class="cx">          if ( false !== $has_order_by && false !== $has_limit ) {
</span><del>-                       // The LIMIT clause cannot appear before the ORDER BY clause in a valid query
-                       // However, since the legacy filter would allow a user to invert the order, we maintain that handling so the same errors are triggered.
</del><ins>+                        /*
+                        * The LIMIT clause cannot appear before the ORDER BY clause in a valid query
+                        * However, since the legacy filter would allow a user to invert the order,
+                        * we maintain that handling so the same errors are triggered.
+                        */
</ins><span class="cx">                   if ( $has_order_by < $has_limit ) {
</span><span class="cx">                          $orderby = trim( str_ireplace( 'order by', '', substr( $sort, 0, $has_limit ) ) );
</span><span class="cx">                          $limits  = trim( substr( $sort, $has_limit ) );
</span></span></pre>
</div>
</div>

</body>
</html>