Created
January 20, 2018 12:11
-
-
Save hawkidoki/266739802b2a88f34d81d7449377753c to your computer and use it in GitHub Desktop.
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 | |
// Post Type Subpages: Ajout des Query Vars | |
add_filter('query_vars', 'hwk_ptsp_query_vars'); | |
function hwk_ptsp_query_vars($vars){ | |
if(!$post_types = hwk_ptsp_get_post_types()) | |
return $vars; | |
foreach($post_types as $post_type){ | |
foreach($post_type['pages'] as $page){ | |
$vars[] = $page['name']; | |
} | |
} | |
return $vars; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment