WordPress at a glance
function is not described

WP_Rewrite::generate_rewrite_rule() public WP 1.5.0

Generates rewrite rules with permalink structure and walking directory only.

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.

{} It's a method of the class: WP_Rewrite{}

No Hooks.

Return

Array.

Usage

global $wp_rewrite;
$wp_rewrite->generate_rewrite_rule( $permalink_structure, $walk_dirs );
$permalink_structure(string) (required)
The permalink structure to generate rules.
$walk_dirs(true/false)
Whether to create list of directories to walk over.
Default: false

Notes

  • See: WP_Rewrite::generate_rewrite_rules() See for long description and rest of parameters.

Changelog

Since 1.5.0 Introduced.

Code of WP_Rewrite::generate_rewrite_rule() WP 5.5.1

<?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 );
}