Skip to content

Instantly share code, notes, and snippets.

@qstudio
Created August 29, 2020 19:21
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 qstudio/50fe2cec716b555b2cbd1813f6383d5a to your computer and use it in GitHub Desktop.
Save qstudio/50fe2cec716b555b2cbd1813f6383d5a to your computer and use it in GitHub Desktop.
// EUD - export args ##
\add_filter( 'q/eud/export/args', [ get_class(), 'export_args' ], 10, 1 );
/**
* Filter export args in EUD plugin
*
* @since 2.0.0
*/
public static function export_args( $args = null )
{
if ( is_null( $args ) ) {
return $args;
}
// in our export "program" is the ID of post in a custom post_type
// Check if a specific program was requested ##
if (
$_POST
&& isset( $_POST['program'] )
&& $_POST['program'] != ''
) {
$args['meta_key'] = 'q_program_id';
$args['meta_value'] = (int)$_POST['program'];
$args['meta_compare'] = '=';
}
// kick it back ##
return $args;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment