Note: You are viewing the documentation for Version 3View Version 4 Docs

Documentation

View the installation guide, browse the Knowledge Base, find out about SearchWP's many hooks, get support

Available since: 3.0

searchwp_acf_remove_field_reference

View Parameters »

Note: Use of this hook will require a manual reindex

This hook allows for individual processing of Advanced Custom Fields field reference post meta records. In order for this hook to fire searchwp_acf_remove_field_references must be set to return true.

When applicable, using this hook you have individual control over reach ACF field reference metadata record.

See also: https://searchwp.com/docs/hooks/searchwp_acf_remove_field_references/

<?php
add_filter( 'searchwp_acf_remove_field_reference', function( $remove, $context ) {
// TODO: Determine whether this field should be removed.
return $remove; // true/false
}, 20, 2 );
view raw functions.php hosted with ❤ by GitHub

Parameters

Parameter Type Description
$remove Boolean

Whether the single ACF field reference should be removed

$context Array

$context['metakey'] The meta key
$context['post_type'] The post type

Fix keyword search on your site. No coding required!

Now you can utilize all of the content that's gone unrecognized by native WordPress keyword search instantly with SearchWP

Get SearchWP