wpseek.com
Bazujące na WordPress narzędzie wyszukiwania dla deweloperów i twórców motywów.



add_permastruct › WordPress Function

Od3.0.0
Przestarzałyn/a
add_permastruct ( $name, $struct, $args = array() )
Parametry: (3)
  • (string) $name Name for permalink structure.
    Wymagane: Tak
  • (string) $struct Permalink structure.
    Wymagane: Tak
  • (array) $args Optional. Arguments for building the rules from the permalink structure, see WP_Rewrite::add_permastruct() for full details. Default empty array.
    Wymagane: Nie
    Domyślny: array()
Zobacz:
Zdefiniowane na:
Codex:

Adds a permalink structure.



Źródło

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