Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 'rewrite' => array( "slug" => "myplugin", "with_front" => true )
- function cpt_add_rewrite_rules() {
- $cpt='events';
- add_rewrite_rule($cpt.'/([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})?$',
- 'index.php?post_type='.$cpt.'&year=$matches[1]&monthnum=$matches[2]&day=$matches[3]',
- 'top');
- add_rewrite_rule($cpt.'/([0-9]{4})/([0-9]{1,2})?$',
- 'index.php?post_type='.$cpt.'&year=$matches[1]&monthnum=$matches[2]',
- 'top');
- add_rewrite_rule($cpt.'/([0-9]{4})?$',
- 'index.php?post_type='.$cpt.'&year=$matches[1]',
- 'top');
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement