Rewrite::filter_handled_rewrite_rules( TribeEventsProViewsV2array $handled_rules = array(), TribeEventsProViewsV2array $all_rules = array() )
Filters the handled rewrite rules, the one used to parse plain links into permalinks, to add the ones managed by PRO.
Contents
Parameters
- $handled_rules
-
(<span class="TribeEventsProViewsV2array">TribeEventsProViewsV2array) (Optional) The handled rules, as produced by The Events Calendar base code; in the same format used by WordPress to store and manage rewrite rules.
Default value: array()
- $all_rules
-
(<span class="TribeEventsProViewsV2array">TribeEventsProViewsV2array) (Optional) All the rewrite rules handled by WordPress.
Default value: array()
Return
(TribeEventsProViewsV2array<string,string>) The filtered rewrite rules, including the ones handled by Events PRO; in the same format used by WordPress to handle rewrite rules.
Source
File: src/Tribe/Views/V2/Rewrite.php
public function filter_handled_rewrite_rules( array $handled_rules = [], array $all_rules = [] ) { $venue_rules = array_filter( $all_rules, static function ( $rewrite ) { return false !== strpos( $rewrite, Venue::POSTTYPE . '=$matches' ); } ); $organizer_rules = array_filter( $all_rules, static function ( $rewrite ) { return false !== strpos( $rewrite, Organizer::POSTTYPE . '=$matches' ); } ); return array_unique( array_merge( $handled_rules, $venue_rules, $organizer_rules ) ); }
Changelog
Version | Description |
---|---|
5.0.1 | Introduced. |