Hello Markus,
Is there a way to use a gd_category as a filter, when exporting.
Instead of adding Post Types.
For me it seems Post Types and Categories are same.
Sorry, currently it is not possible to export listings for particular category/categories.
But you can use following PHP snippet to export listings for particular category.
/**
* Export listings by category.
*/
function gd_snippet_240619_export_filter_category( $where, $post_type ) {
global $wpdb;
/*** CATEGORY ID ***/
$category_id = 34;
/*** CATEGORY ID ***/
$table = geodir_db_cpt_table( $post_type );
$where .= $wpdb->prepare( " AND ( FIND_IN_SET( %d, {$table}.post_category ) OR {$table}.default_category = %d )", array( $category_id, $category_id ) );
geodir_error_log( $where, $post_type, __FILE__, __LINE__ );
return $where;
}
add_filter( 'geodir_get_posts_count', 'gd_snippet_240619_export_filter_category', 100, 2 );
add_filter( 'geodir_get_export_posts','gd_snippet_240619_export_filter_category', 100, 2 );
Regards,
Kiran