Inventory_Presser_Additional_Listings_Pages::add_rewrite_rules( array $rules )

add_rewrite_rules


Description Description

Adds rewrite rules so WordPress recognizes the places where users want the additional listing pages to live.


Top ↑

Parameters Parameters

$rules

(array) (Required)


Top ↑

Return Return

(array)


Top ↑

Source Source

File: includes/class-additional-listings-pages.php

	function add_rewrite_rules( $rules ) {
		foreach ( self::additional_listings_pages_array() as $additional_listing ) {
			// is this rule valid?
			if ( ! self::is_valid_rule( $additional_listing ) ) {
				continue;
			}

			/**
			 * Create a base rule for this slug because this isn't a
			 * post type that will just work.
			 */
			$rules[ $additional_listing['url_path'] . '/?$' ] = 'index.php?post_type=' . INVP::POST_TYPE;
		}
		return $rules;
	}