WP_Rewrite::page_rewrite_rules() WordPress Method

The WP_Rewrite::page_rewrite_rules() method is used to generate the rewrite rules for WordPress pages. This is a method of the WP_Rewrite class.

WP_Rewrite::page_rewrite_rules() #

Retrieves all of the rewrite rules for pages.


Return

(string[]) Page rewrite rules.


Top ↑

Source

File: wp-includes/class-wp-rewrite.php

	public function page_rewrite_rules() {
		// The extra .? at the beginning prevents clashes with other regular expressions in the rules array.
		$this->add_rewrite_tag( '%pagename%', '(.?.+?)', 'pagename=' );

		return $this->generate_rewrite_rules( $this->get_page_permastruct(), EP_PAGES, true, true, false, false );
	}


Top ↑

Changelog

Changelog
VersionDescription
1.5.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.