Created
March 16, 2016 20:29
-
-
Save carlodaniele/8745bac8d290b9b17df0 to your computer and use it in GitHub Desktop.
Add book-author rewrite rule
This file contains 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 | |
/** | |
* Add rewrite rules | |
* | |
* @link https://codex.wordpress.org/Rewrite_API/add_rewrite_rule | |
*/ | |
function myplugin_rewrite_rule() { | |
add_rewrite_rule( '^book/book-author/([^/]*)/?', 'index.php?post_type=book&book-author=$matches[1]','top' ); | |
} | |
add_action('init', 'myplugin_rewrite_rule', 10, 0); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment