AnsPress_Rewrite::rewrite_rules()

Description #

Generate rewrite rules for AnsPress.

Changelog #

VersionDescription
4.1.0Introduced.

Source #

File: includes/rewrite.php

	public static function rewrite_rules() {
		global $wp_rewrite;
		$q_struct = AnsPress_PostTypes::question_perm_structure();
		$rules    = $wp_rewrite->generate_rewrite_rules( $q_struct->rule, EP_NONE, false, false, true );

		$rule = key( $rules );

		anspress()->question_rule = array(
			'rule'    => substr( $rule, 0, -3 ),
			'rewrite' => reset( $rules ),
		);
	}

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Add your comment