Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hawkidoki/266739802b2a88f34d81d7449377753c to your computer and use it in GitHub Desktop.
Save hawkidoki/266739802b2a88f34d81d7449377753c to your computer and use it in GitHub Desktop.
<?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