函数原型
add_rewrite_endpoint( string $name, int $places, string|bool $query_var = true )
函数描述
Adds an endpoint, like /trackback/.
是否弃用
未弃用
函数参数
-
$name
string
Required - Name of the endpoint.
-
$places
int
Required - Endpoint mask describing the places the endpoint should be added.
Accepts a mask of:EP_ALLEP_NONEEP_ALL_ARCHIVESEP_ATTACHMENTEP_AUTHORSEP_CATEGORIESEP_COMMENTSEP_DATEEP_DAYEP_MONTHEP_PAGESEP_PERMALINKEP_ROOTEP_SEARCHEP_TAGSEP_YEAR
-
$query_var
string|bool
Optional - Name of the corresponding query variable. Pass
falseto skip registering a query_var for this endpoint. Defaults to the value of$name.Default:
true
函数返回值
无
函数位置
File: wp-includes/rewrite.php.
函数源码
add_rewrite_endpoint( 'json', EP_PERMALINK | EP_PAGES );源码链接
变更日志
| Version | Description |
|---|---|
| 4.3.0 | Added support for skipping query var registration by passing false to $query_var. |
| 2.1.0 | Introduced. |

