add_permastruct

Advertisement

Summery Summery

Add permalink structure.

Syntax Syntax

add_permastruct( string $name, string $struct, array $args = array() )

Parameters Parameters

$name

(Required) Name for permalink structure.

$struct

(Required) Permalink structure.

$args

(Optional) Arguments for building the rules from the permalink structure, see WP_Rewrite::add_permastruct() for full details.

Default value: array()

Source Source

File: wp-includes/rewrite.php

function add_permastruct( $name, $struct, $args = array() ) {
	global $wp_rewrite;

	// Back-compat for the old parameters: $with_front and $ep_mask.
	if ( ! is_array( $args ) ) {
		$args = array( 'with_front' => $args );
	}
	if ( func_num_args() == 4 ) {
		$args['ep_mask'] = func_get_arg( 3 );
	}

	$wp_rewrite->add_permastruct( $name, $struct, $args );
}

Advertisement

Changelog Changelog

Changelog
Version Description
3.0.0 Introduced.

See also See also

Advertisement

Leave a Reply