Skip to content

Instantly share code, notes, and snippets.

@Boldairdev
Boldairdev / custom-search-acf-wordpress.php
Last active Jul 19, 2019 — forked from charleslouis/custom-search-acf-wordpress.php
PHP - Wordpress - Search - wordpress custom search function that encompasses ACF/advanced custom fields and taxonomies and split expression before request
View custom-search-acf-wordpress.php
<?php
**
* [list_searcheable_acf list all the custom fields we want to include in our search query]
* each array member is the name (slug) of the key we want to search
* @return [array] [list of custom fields]
*/
function list_searcheable_acf(){
$list_searcheable_acf = array("productean", "productidentart", "productnumart", "productauthors", "_sku");
return $list_searcheable_acf;