WordPress.org

Codex

Interested in functions, hooks, classes, or methods? Check out the new WordPress Code Reference!

Function Reference/add permastruct

Description

add_permastruct() allows you to specify additional permalink structures for WordPress. It is most commonly used in conjunction with add_rewrite_tag() and add_rewrite_rule()

Usage

add_permastruct($name, $struct, $args);

Parameters

$name
(string) (required) Name for permalink structure.
Default: None
$struct
(string) (required) Permalink structure.
Default: None
$args
(array) (optional) Optional configuration for building the rules from the permalink structure, see WP_Rewrite::add_permastruct() for full details.
Default: array

Possible Arguments

with_front
(boolean) Should the structure be prepended with WP_Rewrite::$front? Default is true.
ep_mask
(integer) Endpoint mask defining what endpoints are added to the structure. Default is EP_NONE.
paged
(boolean) Should archive pagination rules be added for the structure? Default is true.
feed
(boolean) Should feed rewrite rules be added for the structure? Default is true.
forcomments
(boolean) Should the feed rules be a query for a comments feed? Default is false.
walk_dirs
(boolean) Should the 'directories' making up the structure be walked over and rewrite rules built for each in turn? Default is true.
endpoints 
(boolean) Should endpoints be applied to the generated rewrite rules? Default is true.

Source File

add_permastruct() is located in wp-includes/rewrite.php

Related

Articles

Hooks

Functions