add_permastruct() - WordPress 函数参考中文文档

返回介绍

add_permastruct()

发布于 2017-09-10 字数1774 浏览 1069 评论 0

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

Add permalink structure.


描述


参数

$name

(string)
(Required)
Name for permalink structure.

$struct

(string)
(Required)
Permalink structure.

$args

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

Default value: array()


源代码

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

更新日志

Version 描述
3.0.0 Introduced.

相关函数

Uses

  • wp-includes/class-wp-rewrite.php:
    WP_Rewrite::add_permastruct()

Used By

  • wp-includes/class-wp-taxonomy.php:
    WP_Taxonomy::add_rewrite_rules()
  • wp-includes/class-wp-post-type.php:
    WP_Post_Type::add_rewrite_rules()

User Contributed Notes

上一篇:add_pages_page()

下一篇:add_ping()

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

目前还没有任何评论,快来抢沙发吧!