WordPress开发者和主题制作者的搜索引擎



add_permastruct ›

Since3.0.0
已弃用n/a
add_permastruct ( $name, $struct, $args = array() )
参数: (3)
  • (string) $name Name for permalink structure.
    Required: Yes
  • (string) $struct Permalink structure.
    Required: Yes
  • (array) $args Optional. Arguments for building the rules from the permalink structure, see WP_Rewrite::add_permastruct() for full details. Default empty array.
    Required: No
    默认: array()
查看:
定义在:
文档:

Add permalink structure.



源码

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