W3cubDocs

/WordPress

WP_Rewrite::using_index_permalinks()

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

Description

Means that permalink links are enabled and index.php is in the URL.

Return

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

Source

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

public function using_index_permalinks() {
		if ( empty( $this->permalink_structure ) ) {
			return false;
		}

		// If the index is not in the permalink, we're using mod_rewrite.
		return preg_match( '#^/*' . $this->index . '#', $this->permalink_structure );
	}

Changelog

Version Description
1.5.0 Introduced.

© 2003–2019 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/wp_rewrite/using_index_permalinks