Uses
Uses | Description |
---|---|
wp-includes/class-wp-rewrite.php: WP_Rewrite::get_date_permastruct() | Retrieves date permalink structure, with year, month, and day. |
Retrieves the year permalink structure without month and day.
Gets the date permalink structure and strips out the month and day permalink structures.
(string|false) Year permalink structure on success, false on failure.
File: wp-includes/class-wp-rewrite.php
public function get_year_permastruct() { $structure = $this->get_date_permastruct(); if ( empty( $structure ) ) { return false; } $structure = str_replace( '%monthnum%', '', $structure ); $structure = str_replace( '%day%', '', $structure ); $structure = preg_replace( '#/+#', '/', $structure ); return $structure; }
Version | Description |
---|---|
1.5.0 | Introduced. |
© 2003–2019 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/wp_rewrite/get_year_permastruct