WP_Rewrite::get_extra_permastruct() WordPress Method
The WP_Rewrite::get_extra_permastruct() method is used to get the extra permastruct for a specific permalink. This method is useful for custom post types and taxonomies, which may have their own permastructs. By default, this method will return an empty string.
WP_Rewrite::get_extra_permastruct( string $name ) #
Retrieves an extra permalink structure by name.
Parameters
- $name
(string)(Required)Permalink structure name.
Return
(string|false) Permalink structure string on success, false on failure.
Source
File: wp-includes/class-wp-rewrite.php
public function get_extra_permastruct( $name ) { if ( empty( $this->permalink_structure ) ) { return false; } if ( isset( $this->extra_permastructs[ $name ] ) ) { return $this->extra_permastructs[ $name ]['struct']; } return false; }
Expand full source codeCollapse full source codeView on TracView on GitHub
Changelog
Version | Description |
---|---|
2.5.0 | Introduced. |