WP_Rewrite::using_permalinks() WordPress Method

The WP_Rewrite::using_permalinks() method allows you to check if permalinks are enabled in WordPress. This can be useful for plugin and theme developers who need to know whether to generate links with the WordPress Permalink structure or not.

WP_Rewrite::using_permalinks() #

Determines whether permalinks are being used.


Description

This can be either rewrite module or permalink in the HTTP query string.


Top ↑

Return

(bool) True, if permalinks are enabled.


Top ↑

More Information

Returns true if your blog is using any permalink structure (i.e. not the default query URIs ?p=n, ?cat=n).


Top ↑

Source

File: wp-includes/class-wp-rewrite.php

	public function using_permalinks() {
		return ! empty( $this->permalink_structure );
	}


Top ↑

Changelog

Changelog
VersionDescription
1.5.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.