WP_Rewrite::generate_rewrite_rule() WordPress Method

The WP_Rewrite::generate_rewrite_rule() method is used to generate a rewrite rule for a given permastruct. This method is used internally by WordPress to generate rewrite rules for permalinks. It is not intended to be used directly by developers.

WP_Rewrite::generate_rewrite_rule( string $permalink_structure, bool $walk_dirs = false ) #

Generates rewrite rules with permalink structure and walking directory only.


Description

Shorten version of WP_Rewrite::generate_rewrite_rules() that allows for shorter list of parameters. See the method for longer description of what generating rewrite rules does.

Top ↑

See also


Top ↑

Parameters

$permalink_structure

(string)(Required)The permalink structure to generate rules.

$walk_dirs

(bool)(Optional) Whether to create list of directories to walk over.

Default value: false


Top ↑

Return

(array)


Top ↑

Source

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

	public function generate_rewrite_rule( $permalink_structure, $walk_dirs = false ) {
		return $this->generate_rewrite_rules( $permalink_structure, EP_NONE, false, false, false, $walk_dirs );
	}


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.