Skip to content

Instantly share code, notes, and snippets.

@jchristopher
Created April 24, 2019 18:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jchristopher/b6fd086fc448bf0e640ed4b011bb42ba to your computer and use it in GitHub Desktop.
Save jchristopher/b6fd086fc448bf0e640ed4b011bb42ba to your computer and use it in GitHub Desktop.
Combine some Custom Fields into groups when configuring SearchWP engines
<?php
// Combine some Custom Fields into groups when configuring SearchWP engines.
add_filter( 'searchwp_meta_groups', function( $meta_groups, $args ) {
// Create a meta group in the SearchWP engine Custom Field dropdown
// called 'My Meta Group' with meta_key_1 and meta_key_2 inside.
$meta_groups['my_meta_group'] => array(
'label' => 'My Meta Group',
'metakeys' => array(
'my_meta_key_1',
'my_meta_key_2',
),
);
return $meta_groups;
}, 20, 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment