Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: rewrite_rules

To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).

Understanding Source Code

The best way to understand what a hook does is to look at where it occurs in the source code.

Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.

Source View

Line Code
920           } else {
921                $rules .= "RewriteCond %{REQUEST_FILENAME} !-f\n" .
922                     "RewriteCond %{REQUEST_FILENAME} !-d\n" .
923                     "RewriteRule . {$home_root}{$this->index} [L]\n";
924           }
925
926           $rules .= "</IfModule>\n";
927
928           $rules = apply_filters('mod_rewrite_rules', $rules);
929           $rules = apply_filters('rewrite_rules', $rules);  // Deprecated
930
931           return $rules;
932      }
933
934      //Add a straight rewrite rule
935      function add_rule($regex, $redirect, $after = 'bottom') {
936           //get everything up to the first ?
937           $index = (strpos($redirect, '?') == false ? strlen($redirect) : strpos($redirect, '?'));
938           $front = substr($redirect, 0, $index);