Skip to content

Instantly share code, notes, and snippets.

@ringmaster
Created September 4, 2014 01:35
Show Gist options
  • Save ringmaster/472ad6f0423920a6ea5e to your computer and use it in GitHub Desktop.
Save ringmaster/472ad6f0423920a6ea5e to your computer and use it in GitHub Desktop.
<?php
//...
public function filter_default_rewrite_rules( $rules ) {
$rules[] = array(
'name' => 'display_invoice',
'parse_regex' => '%^(?P<client_slug>.+?)/invoice/(?P<slug>.+?)/?$%i',
'build_str' => '{$client_slug}/invoice/{$slug}',
'handler' => 'UserThemeHandler',
'action' => 'display_post',
'priority' => 1,
'description' => 'Display Invoice',
'parameters' => serialize( array( 'require_match' => array('Posts', 'rewrite_match_type'), 'content_type'=>'invoice') ),
);
return $rules;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment