Skip to content

Instantly share code, notes, and snippets.

@whitesided
whitesided / custom-search-acf-wordpress.php
Last active July 7, 2022 16:46 — 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
<?php
/**
* [list_searcheable_acf list all the custom fields we want to include in our search query]
* @return [array] [list of custom fields]
*/
function list_searcheable_acf(){
$list_searcheable_acf = array("title", "sub_title", "excerpt_short", "excerpt_long", "xyz", "myACF");
return $list_searcheable_acf;
}
@whitesided
whitesided / examples.php
Created June 23, 2022 21:00 — forked from kingkool68/examples.php
Helper functions to make generating WordPress post type labels and taxonomy labels easier
<?php
// Register a Book post type
$args = array(
'labels' => generate_post_type_labels( 'book', 'books' ),
'public' => true,
'publicly_queryable' => true,
'show_ui' => true,
'show_in_menu' => true,
'query_var' => true,