Skip to content

Instantly share code, notes, and snippets.

@BrElio
BrElio / wp-tweaks.php
Last active October 22, 2019 13:19 — forked from jenniferhail/wp-tweaks.php
Index layouts relationship fields for SearchWP
// Adds additional processing for ACF field with the name my_acf_relationship_field
function my_searchwp_acf_relationship_processor( $customFieldValue, $customFieldName, $thePost ){
$content_to_index = '';
if ( 'partner_filter' == $customFieldName ) {
$partner_filter = $customFieldValue[0];
}
preg_match( '/^layouts_\d+_post_type/i', $customFieldName, $matches );
if( 'post_type' == $customFieldName || ( ! empty( $matches ) && is_array( $customFieldValue ) && ! empty( $customFieldValue ) ) ){
$post_type = $customFieldValue[0];
@BrElio
BrElio / gist:e8b2bdb18b480c6c44836c9174038929
Created February 5, 2018 09:19 — forked from jchristopher/gist:596cab51f1ec6727cb4a
Include Download Monitor post type in SearchWP
<?php
function my_dlm_cpt_dlm_download_args( $args ) {
$args['exclude_from_search'] = false;
return $args;
}
add_filter( 'dlm_cpt_dlm_download_args', 'my_dlm_cpt_dlm_download_args' );
@BrElio
BrElio / gist:df0fafc71c41a31f031b76ad77f3d466
Created December 4, 2017 17:24 — forked from jchristopher/gist:3135783eb3521bebbc5e
Disable the default SearchWP Live Search results theme CSS while retaining the positioning
<?php
function my_remove_searchwp_live_search_theme_css() {
wp_dequeue_style( 'searchwp-live-search' );
}
add_action( 'wp_enqueue_scripts', 'my_remove_searchwp_live_search_theme_css', 99 );