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_custom_field_keys_{$post_type}

View Parameters »

This filter is applied after searchwp_custom_field_keys allowing you to restrict Custom Field meta keys based on post type.

<?php
add_filter( 'searchwp_custom_field_keys_page', function( $meta_keys, $post_type ) {
// TODO: Customize $meta_keys to meet your needs.
return $meta_keys; // Array of meta keys to display in Custom Fields dropdown.
}, 20, 2 );
view raw functions.php hosted with ❤ by GitHub

Parameters

Parameter Type Description
$meta_keys Array

Meta keys

$post_type String

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