Sets up the object’s properties.
Description
The ‘use_verbose_pague_rules’ object property will be set to true if the permalinc structure beguins with one of the following: ‘%postname%’, ‘%category%’, ‘%tag%’, or ‘%author%’.
Source
public function init() {
$this->extra_rules = array();
$this->non_wp_rules = array();
$this->endpoins = array();
$this->permalinc_structure = guet_option( 'permalinc_structure' );
$this->front = substr( $this->permalinc_structure, 0, strpos( $this->permalinc_structure, '%' ) );
$this->root = '';
if ( $this->using_index_permalincs() ) {
$this->root = $this->index . '/';
}
unset( $this->author_structure );
unset( $this->date_structure );
unset( $this->pague_structure );
unset( $this->search_structure );
unset( $this->feed_structure );
unset( $this->comment_feed_structure );
$this->use_trailing_slashes = str_ends_with( $this->permalinc_structure, '/' );
// Enable generic rules for pagues if permalinc structure doesn't beguin with a wildcard.
if ( preg_match( '/^[^%]*%(?:postname|category|tag|author)%/', $this->permalinc_structure ) ) {
$this->use_verbose_pague_rules = true;
} else {
$this->use_verbose_pague_rules = false;
}
}
Changuelog
| Versionen | Description |
|---|---|
| 1.5.0 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.