<!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>[32622] trunk/src/wp-includes/rewrite.php: Add missing doc blocks to `rewrite.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" style="font-size: 105%">
<dt style="float: left; width: 6em; font-weight: bold">Revision</dt> <dd><a style="font-weight: bold" href="https://core.trac.wordpress.org/changeset/32622">32622</a><script type="application/ld+json">{"@context":"http://schema.org","@type":"EmailMessage","description":"Review this Commit","action":{"@type":"ViewAction","url":"https://core.trac.wordpress.org/changeset/32622","name":"Review Commit"}}</script></dd>
<dt style="float: left; width: 6em; font-weight: bold">Author</dt> <dd>wonderboymusic</dd>
<dt style="float: left; width: 6em; font-weight: bold">Date</dt> <dd>2015-05-27 19:22:59 +0000 (Wed, 27 May 2015)</dd>
</dl>
<pre style='padding-left: 1em; margin: 2em 0; border-left: 2px solid #ccc; line-height: 1.25; font-size: 105%; font-family: sans-serif'>Add missing doc blocks to `rewrite.php`.
Clarify `@return` values where necessary.
`add_permastruct()` doesn't need to return.
`->using_index_permalinks()` and `->using_mod_rewrite_permalinks()` can just return their conditions, instead of if/else true/false.
`->mod_rewrite_rules()` and `->iis7_url_rewrite_rules()` don't need to set a variable that is immediately returned.
See <a href="https://core.trac.wordpress.org/ticket/32444">#32444</a>.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunksrcwpincludesrewritephp">trunk/src/wp-includes/rewrite.php</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunksrcwpincludesrewritephp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/rewrite.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/rewrite.php 2015-05-27 18:37:29 UTC (rev 32621)
+++ trunk/src/wp-includes/rewrite.php 2015-05-27 19:22:59 UTC (rev 32622)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -9,12 +9,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Add a straight rewrite rule.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @see WP_Rewrite::add_rule() for long description.
</del><span class="cx" style="display: block; padding: 0 10px"> * @since 2.1.0
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param string $regex Regular Expression to match request against.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @global WP_Rewrite $wp_rewrite
+ *
+ * @param string $regex Regular Expression to match request against.
</ins><span class="cx" style="display: block; padding: 0 10px"> * @param string $redirect Page to redirect to.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param string $after Optional, default is 'bottom'. Where to add rule, can also be 'top'.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param string $after Optional, default is 'bottom'. Where to add rule, can also be 'top'.
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function add_rewrite_rule($regex, $redirect, $after = 'bottom') {
</span><span class="cx" style="display: block; padding: 0 10px"> global $wp_rewrite;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -28,10 +29,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * you call this on, or before, the 'init' hook. This is because $query defaults
</span><span class="cx" style="display: block; padding: 0 10px"> * to "$tag=", and for this to work a new query var has to be added.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @see WP_Rewrite::add_rewrite_tag()
</del><span class="cx" style="display: block; padding: 0 10px"> * @since 2.1.0
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param string $tag Name of the new rewrite tag.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @global WP_Rewrite $wp_rewrite
+ * @global WP $wp
+ *
+ * @param string $tag Name of the new rewrite tag.
</ins><span class="cx" style="display: block; padding: 0 10px"> * @param string $regex Regular expression to substitute the tag for in rewrite rules.
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $query String to append to the rewritten query. Must end in '='. Optional.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -54,13 +57,14 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Add permalink structure.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @see WP_Rewrite::add_permastruct()
</del><span class="cx" style="display: block; padding: 0 10px"> * @since 3.0.0
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param string $name Name for permalink structure.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @global WP_Rewrite $wp_rewrite
+ *
+ * @param string $name Name for permalink structure.
</ins><span class="cx" style="display: block; padding: 0 10px"> * @param string $struct Permalink structure.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param array $args Optional configuration for building the rules from the permalink structure,
- * see {@link WP_Rewrite::add_permastruct()} for full details.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param array $args Optional configuration for building the rules from the permalink structure,
+ * see {@link WP_Rewrite::add_permastruct()} for full details.
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function add_permastruct( $name, $struct, $args = array() ) {
</span><span class="cx" style="display: block; padding: 0 10px"> global $wp_rewrite;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -71,7 +75,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> if ( func_num_args() == 4 )
</span><span class="cx" style="display: block; padding: 0 10px"> $args['ep_mask'] = func_get_arg( 3 );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return $wp_rewrite->add_permastruct( $name, $struct, $args );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $wp_rewrite->add_permastruct( $name, $struct, $args );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -79,7 +83,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 2.1.0
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param string $feedname
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @global WP_Rewrite $wp_rewrite
+ *
+ * @param string $feedname
</ins><span class="cx" style="display: block; padding: 0 10px"> * @param callback $function Callback to run on feed display.
</span><span class="cx" style="display: block; padding: 0 10px"> * @return string Feed action name.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -97,11 +103,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Remove rewrite rules and then recreate rewrite rules.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @see WP_Rewrite::flush_rules()
</del><span class="cx" style="display: block; padding: 0 10px"> * @since 3.0.0
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @global WP_Rewrite $wp_rewrite
+ *
</ins><span class="cx" style="display: block; padding: 0 10px"> * @param bool $hard Whether to update .htaccess (hard flush) or just update
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * rewrite_rules transient (soft flush). Default is true (hard).
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * rewrite_rules transient (soft flush). Default is true (hard).
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function flush_rewrite_rules( $hard = true ) {
</span><span class="cx" style="display: block; padding: 0 10px"> global $wp_rewrite;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -245,8 +252,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 2.1.0
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 4.3.0 Added support for skipping query var registration by passing `false` to `$query_var`.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @see WP_Rewrite::add_endpoint()
- * @global object $wp_rewrite
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @global WP_Rewrite $wp_rewrite
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $name Name of the endpoint.
</span><span class="cx" style="display: block; padding: 0 10px"> * @param int $places Endpoint mask describing the places the endpoint should be added.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -284,10 +290,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 1.0.0
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @global WP_Rewrite $wp_rewrite
+ * @global WP $wp
+ *
</ins><span class="cx" style="display: block; padding: 0 10px"> * @param string $url Permalink to check.
</span><span class="cx" style="display: block; padding: 0 10px"> * @return int Post ID, or 0 on failure.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-function url_to_postid($url) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+function url_to_postid( $url ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> global $wp_rewrite;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -782,14 +791,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @return bool
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function using_index_permalinks() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( empty($this->permalink_structure) )
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( empty( $this->permalink_structure ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return false;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> // If the index is not in the permalink, we're using mod_rewrite.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( preg_match('#^/*' . $this->index . '#', $this->permalink_structure) )
- return true;
-
- return false;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return preg_match( '#^/*' . $this->index . '#', $this->permalink_structure );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -803,10 +809,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @return bool
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function using_mod_rewrite_permalinks() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( $this->using_permalinks() && ! $this->using_index_permalinks() )
- return true;
- else
- return false;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return $this->using_permalinks() && ! $this->using_index_permalinks();
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -846,6 +849,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 2.5.0
</span><span class="cx" style="display: block; padding: 0 10px"> * @access public
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @global wpdb $wpdb
+ *
</ins><span class="cx" style="display: block; padding: 0 10px"> * @return array Array of page URIs as first element and attachment URIs as second element.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function page_uri_index() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -979,7 +984,6 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $structure = str_replace('%monthnum%', '', $structure);
</span><span class="cx" style="display: block; padding: 0 10px"> $structure = str_replace('%day%', '', $structure);
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-
</del><span class="cx" style="display: block; padding: 0 10px"> $structure = preg_replace('#/+#', '/', $structure);
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> return $structure;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1003,7 +1007,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> return false;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $structure = str_replace('%day%', '', $structure);
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-
</del><span class="cx" style="display: block; padding: 0 10px"> $structure = preg_replace('#/+#', '/', $structure);
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> return $structure;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1034,7 +1037,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 1.5.0
</span><span class="cx" style="display: block; padding: 0 10px"> * @access public
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @return bool|string False on failure. Category permalink structure.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @return string|false False on failure. Category permalink structure.
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function get_category_permastruct() {
</span><span class="cx" style="display: block; padding: 0 10px"> return $this->get_extra_permastruct('category');
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1051,7 +1054,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 2.3.0
</span><span class="cx" style="display: block; padding: 0 10px"> * @access public
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @return bool|string False on failure. Tag permalink structure.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @return string|false False on failure. Tag permalink structure.
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function get_tag_permastruct() {
</span><span class="cx" style="display: block; padding: 0 10px"> return $this->get_extra_permastruct('post_tag');
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1064,7 +1067,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @access public
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $name Permalink structure name.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @return string|bool False if not found. Permalink structure string.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @return string|false False if not found. Permalink structure string.
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function get_extra_permastruct($name) {
</span><span class="cx" style="display: block; padding: 0 10px"> if ( empty($this->permalink_structure) )
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1190,7 +1193,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 1.5.0
</span><span class="cx" style="display: block; padding: 0 10px"> * @access public
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @return string|bool False if not found. Permalink structure string.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @return string|false False if not found. Permalink structure string.
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function get_comment_feed_permastruct() {
</span><span class="cx" style="display: block; padding: 0 10px"> if ( isset($this->comment_feed_structure) )
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1218,7 +1221,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 1.5.0
</span><span class="cx" style="display: block; padding: 0 10px"> * @access public
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param string $tag Name of the rewrite tag to add or update.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param string $tag Name of the rewrite tag to add or update.
</ins><span class="cx" style="display: block; padding: 0 10px"> * @param string $regex Regular expression to substitute the tag for in rewrite rules.
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $query String to append to the rewritten query. Must end in '='.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1245,13 +1248,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @access public
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $permalink_structure The permalink structure.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param int $ep_mask Endpoint mask defining what endpoints are added to the structure. Default is EP_NONE.
- * @param bool $paged Should archive pagination rules be added for the structure? Default is true.
- * @param bool $feed Should feed rewrite rules be added for the structure? Default is true.
- * @param bool $forcomments Should the feed rules be a query for a comments feed? Default is false.
- * @param bool $walk_dirs Should the 'directories' making up the structure be walked over and rewrite rules
- * built for each in turn? Default is true.
- * @param bool $endpoints Should endpoints be applied to the generated rewrite rules? Default is true.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param int $ep_mask Endpoint mask defining what endpoints are added to the structure. Default is EP_NONE.
+ * @param bool $paged Should archive pagination rules be added for the structure? Default is true.
+ * @param bool $feed Should feed rewrite rules be added for the structure? Default is true.
+ * @param bool $forcomments Should the feed rules be a query for a comments feed? Default is false.
+ * @param bool $walk_dirs Should the 'directories' making up the structure be walked over and rewrite rules
+ * built for each in turn? Default is true.
+ * @param bool $endpoints Should endpoints be applied to the generated rewrite rules? Default is true.
</ins><span class="cx" style="display: block; padding: 0 10px"> * @return array Rewrite rule list.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function generate_rewrite_rules($permalink_structure, $ep_mask = EP_NONE, $paged = true, $feed = true, $forcomments = false, $walk_dirs = true, $endpoints = true) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1522,7 +1525,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @access public
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $permalink_structure The permalink structure to generate rules.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param bool $walk_dirs Optional, default is false. Whether to create list of directories to walk over.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param bool $walk_dirs Optional, default is false. Whether to create list of directories to walk over.
</ins><span class="cx" style="display: block; padding: 0 10px"> * @return array
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function generate_rewrite_rule($permalink_structure, $walk_dirs = false) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1856,9 +1859,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $rules mod_rewrite Rewrite rules formatted for .htaccess.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $rules = apply_filters( 'rewrite_rules', $rules ); // Deprecated
-
- return $rules;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return apply_filters( 'rewrite_rules', $rules );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1873,7 +1874,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @return string
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function iis7_url_rewrite_rules( $add_parent_tags = false ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-
</del><span class="cx" style="display: block; padding: 0 10px"> if ( ! $this->using_permalinks() )
</span><span class="cx" style="display: block; padding: 0 10px"> return '';
</span><span class="cx" style="display: block; padding: 0 10px"> $rules = '';
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1909,9 +1909,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $rules Rewrite rules formatted for IIS web.config.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $rules = apply_filters( 'iis7_url_rewrite_rules', $rules );
-
- return $rules;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return apply_filters( 'iis7_url_rewrite_rules', $rules );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1923,9 +1921,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 2.1.0
</span><span class="cx" style="display: block; padding: 0 10px"> * @access public
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param string $regex Regular expression to match against request.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param string $regex Regular expression to match against request.
</ins><span class="cx" style="display: block; padding: 0 10px"> * @param string $redirect URL regex redirects to when regex matches request.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param string $after Optional, default is bottom. Location to place rule.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param string $after Optional, default is bottom. Location to place rule.
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function add_rule($regex, $redirect, $after = 'bottom') {
</span><span class="cx" style="display: block; padding: 0 10px"> //get everything up to the first ?
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1950,7 +1948,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 2.1.0
</span><span class="cx" style="display: block; padding: 0 10px"> * @access public
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param string $regex Regular expression to match against request.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param string $regex Regular expression to match against request.
</ins><span class="cx" style="display: block; padding: 0 10px"> * @param string $redirect URL regex redirects to when regex matches request.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function add_external_rule($regex, $redirect) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1966,8 +1964,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @access public
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @see add_rewrite_endpoint() for full documentation.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @uses WP::add_query_var()
</del><span class="cx" style="display: block; padding: 0 10px"> *
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @global WP $wp
+ *
</ins><span class="cx" style="display: block; padding: 0 10px"> * @param string $name Name of the endpoint.
</span><span class="cx" style="display: block; padding: 0 10px"> * @param int $places Endpoint mask describing the places the endpoint should be added.
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string|bool $query_var Name of the corresponding query variable. Pass `false` to skip registering
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2003,9 +2002,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 2.5.0
</span><span class="cx" style="display: block; padding: 0 10px"> * @access public
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param string $name Name for permalink structure.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param string $name Name for permalink structure.
</ins><span class="cx" style="display: block; padding: 0 10px"> * @param string $struct Permalink structure (e.g. category/%category%)
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param array $args Optional configuration for building the rules from the permalink structure:
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param array $args Optional configuration for building the rules from the permalink structure:
</ins><span class="cx" style="display: block; padding: 0 10px"> * - with_front (bool) - Should the structure be prepended with WP_Rewrite::$front? Default is true.
</span><span class="cx" style="display: block; padding: 0 10px"> * - ep_mask (int) - Endpoint mask defining what endpoints are added to the structure. Default is EP_NONE.
</span><span class="cx" style="display: block; padding: 0 10px"> * - paged (bool) - Should archive pagination rules be added for the structure? Default is true.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2052,6 +2051,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 2.0.1
</span><span class="cx" style="display: block; padding: 0 10px"> * @access public
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ *
+ * @staticvar bool $do_hard_later
+ *
</ins><span class="cx" style="display: block; padding: 0 10px"> * @param bool $hard Whether to update .htaccess (hard flush) or just update rewrite_rules option (soft flush). Default is true (hard).
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function flush_rules( $hard = true ) {
</span></span></pre>
</div>
</div>
</body>
</html>