Created
August 29, 2020 19:21
-
-
Save qstudio/50fe2cec716b555b2cbd1813f6383d5a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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