WP_Rewrite::using_mod_rewrite_permalinks() WordPress Method

The WP_Rewrite::using_mod_rewrite_permalinks() method allows you to check if your WordPress installation is using mod_rewrite to generate permalinks. This is useful for plugin authors who need to know whether their plugins will work with the current permalink structure.

WP_Rewrite::using_mod_rewrite_permalinks() #

Determines whether permalinks are being used and rewrite module is enabled.


Description

Using permalinks and index.php is not in the URL.


Top ↑

Return

(bool) Whether permalink links are enabled and index.php is NOT in the URL.


Top ↑

More Information

Returns true your blog is using “pretty” permalinks via mod_rewrite.


Top ↑

Source

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

	public function using_mod_rewrite_permalinks() {
		return $this->using_permalinks() && ! $this->using_index_permalinks();
	}


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.