Skip to content

Instantly share code, notes, and snippets.

@crawford252
Last active January 18, 2024 16:19
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 crawford252/ce1817ce2ae898c96ec743b536058734 to your computer and use it in GitHub Desktop.
Save crawford252/ce1817ce2ae898c96ec743b536058734 to your computer and use it in GitHub Desktop.
Divi FilterGrid - Alter Query
add_filter( 'dpdfg_ext_set_query_arguments', 'dpdfg_ext_set_query_arguments', 10, 2 );
function dpdfg_ext_set_query_arguments( $query_args, $props ) {
if ( isset( $props['module_class'] ) && $props['module_class'] === 'related-recipes' ) {
$query_args['post_type'] = 'recipe';
}
return $query_args;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment