WordPress at a glance

add_permastruct() WP 1.0

Add permalink structure.

  • See: WP_Rewrite::add_permastruct()
  • Global. WP_Rewrite. $wp_rewrite WordPress rewrite component.
Works based on: WP_Rewrite()

No Hooks.

Return

Nothing (null).

Usage

add_permastruct( $name, $struct, $args );
$name(string) (required)
Name for permalink structure.
$struct(string) (required)
Permalink structure.
$args(array)
Arguments for building the rules from the permalink structure, see WP_Rewrite::add_permastruct() for full details.
Default: empty array

Code of add_permastruct: wp-includes/rewrite.php VER 5.0.1

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

Related Functions

From tag: Rewrite (clean friendly URL)

No comments
    Hello, !     Log In . Register