WP_Rewrite::get_year_permastruct()

Retrieves the year permalink structure without month and day.


Description Description

Gets the date permalink structure and strips out the month and day permalink structures.


Return Return

(false|string) False on failure. Year structure on success.


Top ↑

Source Source

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;
	}

Top ↑

Changelog Changelog

Changelog
Version Description
1.5.0 Introduced.


Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.