$wp_rewrite->feeds[] = $feedname;
}
$hook = 'do_feed_' . $feedname;
- remove_action($hook, $function, 10, 1);
+ // Remove default function hook
+ remove_action($hook, $hook, 10, 1);
add_action($hook, $function, 10, 1);
return $hook;
}
$wp_rewrite->add_endpoint($name, $places);
}
+/**
+ * _wp_filter_taxonomy_base() - filter the URL base for taxonomies, to remove any manually prepended /index.php/
+ * @param string $base the taxonomy base that we're going to filter
+ * @return string
+ * @author Mark Jaquith
+ */
+function _wp_filter_taxonomy_base( $base ) {
+ if ( !empty( $base ) ) {
+ $base = preg_replace( '|^/index\.php/|', '', $base );
+ $base = trim( $base, '/' );
+ }
+ return $base;
+}
+
// examine a url (supposedly from this blog) and try to
// determine the post ID it represents.
function url_to_postid($url) {
$query = preg_replace("!^.+\?!", '', $query);
// Substitute the substring matches into the query.
- eval("\$query = \"$query\";");
+ eval("\$query = \"" . addslashes($query) . "\";");
// Filter out non-public query vars
global $wp;
parse_str($query, $query_vars);
}
if (empty($this->category_base))
- $this->category_structure = $this->front . 'category/';
+ $this->category_structure = trailingslashit( $this->front . 'category' );
else
- $this->category_structure = $this->category_base . '/';
+ $this->category_structure = trailingslashit( '/' . $this->root . $this->category_base );
$this->category_structure .= '%category%';
}
if (empty($this->tag_base))
- $this->tag_structure = $this->front . 'tag/';
+ $this->tag_structure = trailingslashit( $this->front . 'tag' );
else
- $this->tag_structure = $this->tag_base . '/';
+ $this->tag_structure = trailingslashit( '/' . $this->root . $this->tag_base );
$this->tag_structure .= '%tag%';
$robots_rewrite = array('robots.txt$' => $this->index . '?robots=1');
//Default Feed rules - These are require to allow for the direct access files to work with permalink structure starting with %category%
- $default_feeds = array( '.*/wp-atom.php$' => $this->index .'?feed=atom',
- '.*/wp-rdf.php$' => $this->index .'?feed=rdf',
- '.*/wp-rss.php$' => $this->index .'?feed=rss',
- '.*/wp-rss2.php$' => $this->index .'?feed=rss2',
- '.*/wp-feed.php$' => $this->index .'?feed=feed',
- '.*/wp-commentsrss2.php$' => $this->index . '?feed=rss2&withcomments=1');
+ $default_feeds = array( '.*wp-atom.php$' => $this->index .'?feed=atom',
+ '.*wp-rdf.php$' => $this->index .'?feed=rdf',
+ '.*wp-rss.php$' => $this->index .'?feed=rss',
+ '.*wp-rss2.php$' => $this->index .'?feed=rss2',
+ '.*wp-feed.php$' => $this->index .'?feed=feed',
+ '.*wp-commentsrss2.php$' => $this->index . '?feed=rss2&withcomments=1');
// Post
$post_rewrite = $this->generate_rewrite_rules($this->permalink_structure, EP_PERMALINK);