-
-
Save mikelietz/5509273 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| class BlahBlah extends Plugin | |
| { | |
| /** | |
| * Add an author rewrite rule | |
| * @param Array $rules Current rewrite rules | |
| **/ | |
| public function filter_default_rewrite_rules( $rules ) { | |
| $rules[] = array( | |
| 'name' => 'display_entry_by_tag_and_slug', | |
| 'parse_regex' => '%^(?P<tag>[^/]+)/(?P<slug>[^/]+)(?:/page/(?P<page>\d+))?/?$%i', | |
| 'build_str' => '{$tag}/{$slug}(/page/{$page})', | |
| 'action' => 'display_entry_tag', | |
| 'description' => 'Wordpress tag and name based permalink', | |
| 'priority' => 1000 | |
| ); | |
| $rules[] = array( | |
| 'name' => 'display_entry_tag', | |
| 'parse_regex' => '%^(?P<tag>[^/]+)/news/(?P<slug>[^/]+)(?:/page/(?P<page>\d+))?/?$%i', | |
| 'build_str' => '{$tag}/news/{$slug}(/page/{$page})', | |
| 'handler' => 'UserThemeHandler', | |
| 'action' => 'display_post', | |
| 'priority' => 100, | |
| 'description' => 'Return entry matching specified slug and', | |
| 'parameters' => serialize( | |
| array( 'require_match' => array('Posts', 'rewrite_match_type'), 'content_type'=>'entry', 'request_types' => array('display_post') ) | |
| ) | |
| ); | |
| return $rules; | |
| } | |
| } | |
| ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment