WPDev.one
Core Class

WP_Rewrite

class WP_Rewrite // Constructor: function Object() { [native code] }

Core class used to implement a rewrite component API.

Methods 38 methods

Method / Return Description
using_permalinks()
bool

Determines whether permalinks are being used.

using_index_permalinks()
bool

Determines whether permalinks are being used and rewrite module is not enabled.

using_mod_rewrite_permalinks()
bool

Determines whether permalinks are being used and rewrite module is enabled.

preg_index()
string

Indexes for matches for usage in preg_*() functions.

Parameters: $number: mixed
page_uri_index()
array

Retrieves all pages and attachments for pages URIs.

page_rewrite_rules()
string[]

Retrieves all of the rewrite rules for pages.

get_date_permastruct()
(string

Retrieves date permalink structure, with year, month, and day.

get_year_permastruct()
(string

Retrieves the year permalink structure without month and day.

get_month_permastruct()
(string

Retrieves the month permalink structure without day and with year.

get_day_permastruct()
(string

Retrieves the day permalink structure with month and year.

get_category_permastruct()
(string

Retrieves the permalink structure for categories.

get_tag_permastruct()
(string

Retrieves the permalink structure for tags.

get_extra_permastruct()
(string

Retrieves an extra permalink structure by name.

Parameters: $name: mixed
get_author_permastruct()
(string

Retrieves the author permalink structure.

get_search_permastruct()
(string

Retrieves the search permalink structure.

get_page_permastruct()
(string

Retrieves the page permalink structure.

get_feed_permastruct()
(string

Retrieves the feed permalink structure.

get_comment_feed_permastruct()
(string

Retrieves the comment feed permalink structure.

add_rewrite_tag()
void

Adds or updates existing rewrite tags (e.g. %postname%).

Parameters: $tag: mixed, $regex: mixed, $query: mixed
remove_rewrite_tag()
void

Removes an existing rewrite tag.

Parameters: $tag: mixed
generate_rewrite_rules()
string[]

Generates rewrite rules from a permalink structure.

Parameters: $permalink_structure: mixed, $ep_mask: mixed, $paged: mixed, $feed: mixed, $forcomments: mixed, $walk_dirs: mixed, $endpoints: mixed
generate_rewrite_rule()
array

Generates rewrite rules with permalink structure and walking directory only.

Parameters: $permalink_structure: mixed, $walk_dirs: mixed
rewrite_rules()
string[]

Constructs rewrite matches and queries from permalink structure.

wp_rewrite_rules()
string[]

Retrieves the rewrite rules.

refresh_rewrite_rules()
void

Refreshes the rewrite rules, saving the fresh value to the database.

mod_rewrite_rules()
string

Retrieves mod_rewrite-formatted rewrite rules to write to .htaccess.

iis7_url_rewrite_rules()
string

Retrieves IIS7 URL Rewrite formatted rewrite rules to write to web.config file.

Parameters: $add_parent_tags: mixed
add_rule()
void

Adds a rewrite rule that transforms a URL structure to a set of query vars.

Parameters: $regex: mixed, $query: mixed, $after: mixed
add_external_rule()
void

Adds a rewrite rule that doesn't correspond to index.php.

Parameters: $regex: mixed, $query: mixed
add_endpoint()
void

Adds an endpoint, like /trackback/.

Parameters: $name: mixed, $places: mixed, $query_var: mixed
add_permastruct()
void

Adds a new permalink structure.

Parameters: $name: mixed, $struct: mixed, $args: mixed
remove_permastruct()
void

Removes a permalink structure.

Parameters: $name: mixed
flush_rules()
void

Removes rewrite rules and then recreate rewrite rules.

Parameters: $hard: mixed
init()
void

Sets up the object's properties.

set_permalink_structure()
void

Sets the main permalink structure for the site.

Parameters: $permalink_structure: mixed
set_category_base()
void

Sets the category base for the category permalink.

Parameters: $category_base: mixed
set_tag_base()
void

Sets the tag base for the tag permalink.

Parameters: $tag_base: mixed
__construct()
void

Constructor - Calls init(), which runs setup.

Properties

Property / Type Description
$permalink_structure
mixed
public
No description available.
$use_trailing_slashes
mixed
public
No description available.
$author_base
mixed
public
No description available.
$author_structure
mixed
public
No description available.
$date_structure
mixed
public
No description available.
$page_structure
mixed
public
No description available.
$search_base
mixed
public
No description available.
$search_structure
mixed
public
No description available.
$comments_base
mixed
public
No description available.
$pagination_base
mixed
public
No description available.
$comments_pagination_base
mixed
public
No description available.
$feed_base
mixed
public
No description available.
$comment_feed_structure
mixed
public
No description available.
$feed_structure
mixed
public
No description available.
$front
mixed
public
No description available.
$root
mixed
public
No description available.
$index
mixed
public
No description available.
$matches
mixed
public
No description available.
$rules
mixed
public
No description available.
$extra_rules
mixed
public
No description available.
$extra_rules_top
mixed
public
No description available.
$non_wp_rules
mixed
public
No description available.
$extra_permastructs
mixed
public
No description available.
$endpoints
mixed
public
No description available.
$use_verbose_rules
mixed
public
No description available.
$use_verbose_page_rules
mixed
public
No description available.
$rewritecode
mixed
public
No description available.
$rewritereplace
mixed
public
No description available.
$queryreplace
mixed
public
No description available.
$feeds
mixed
public
No description available.

Class Information

Since Version
1.5.0
Source File
wp-includes/class-wp-rewrite.php
Advertisement