Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- function rewrite_rule_by_date() {
- add_rewrite_rule('(by\-date)/(\d{4}\-\d{2}\-\d{2})$', 'index.php?pagename=$matches[1]&wpem_event_date=$matches[2]', 'top');
- }
- add_action( 'init', array( &$this, 'rewrite_rule_by_date' ) );
- function query_var_by_date( $vars ) {
- $vars[] = 'wpem_event_date';
- return $vars;
- }
- add_action( 'query_vars', array( &$this, 'query_var_by_date' ) );
- function flush_rules() {
- global $wp_rewrite;
- $wp_rewrite->flush_rules();
- }
- register_activation_hook( __FILE__, array( &$this, 'flush_rules' ) );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement