Sacconi69

//CERCA PER ID- aggiornato n 2

Oct 24th, 2024
181
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. //CERCA PER ID- aggiornato -2
  2. function search_by_post_id2($query) {
  3. if($query->is_search) {
  4. if(is_numeric($query->query_vars['search'])) {
  5. $query->set('post_type', 'any');
  6. $query->set('include', array((int)$query->query_vars['search']));
  7. $query->set('search', '');
  8. }
  9. }
  10. return $query;
  11. }
  12. add_filter('pre_get_users', 'search_by_post_id2');
  13.  
Advertisement
Add Comment
Please, Sign In to add comment