This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
programmieren:wordpress:nach_cutom_fields_suchen [2022/08/24 19:06] – jgehrke | programmieren:wordpress:nach_cutom_fields_suchen [2022/12/17 12:28] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 14: | Line 14: | ||
<code php> | <code php> | ||
<?php | <?php | ||
+ | |||
/* | /* | ||
HOOK FILTER IN SEARCH | HOOK FILTER IN SEARCH | ||
Line 37: | Line 38: | ||
private $wp_filter_priority | private $wp_filter_priority | ||
+ | //private $acf_post_types | ||
private $limit_search_to_post_types = []; // wp_query » post_types | private $limit_search_to_post_types = []; // wp_query » post_types | ||
private $results_per_page | private $results_per_page | ||
Line 49: | Line 51: | ||
add_filter( ' | add_filter( ' | ||
add_filter( ' | add_filter( ' | ||
- | + | add_filter( ' | |
- | //add_filter( ' | + | |
} | } | ||
Line 128: | Line 129: | ||
} | } | ||
return $distinct_mode_string; | return $distinct_mode_string; | ||
+ | } | ||
+ | |||
+ | |||
+ | |||
+ | /** | ||
+ | * | ||
+ | * | ||
+ | * @link https:// | ||
+ | */ | ||
+ | public function filter_results( $post_objects_array ) { | ||
+ | |||
+ | return $post_objects_array ; | ||
} | } | ||
Line 160: | Line 173: | ||
/** | /** | ||
+ | * | ||
+ | * | ||
* Prüft ob die Suche durch ein ACF Query ausgelöst wurde | * Prüft ob die Suche durch ein ACF Query ausgelöst wurde | ||
* | * | ||
- | * ACF & Die Such-Manipulation vertragen | + | * ACF & die Beschränkung nach Post_Types vertägt |
- | * nur noch Strings zurück gibt. | + | * ACF mit eigenen Posttypes kommt. Darum muss geprüft werden, dass |
+ | * keine Beschränkung in der Suche vorgenommen wird, wenn der call | ||
+ | * über ACF kommt. | ||
+ | * | ||
+ | * Bisher | ||
+ | * abzufragen. | ||
* | * | ||
* @return boolean [description] | * @return boolean [description] | ||
Line 184: | Line 204: | ||
} | } | ||
} | } | ||
+ | |||
</ | </ |