Filter the ItemRequest SQL statement to only include a post type object with specific terms.
Add this code snippet to your themes functions.php
file.
Code Example
/**
* Filter ItemRequest JOIN statement.
*
* @param string $join
* @param string $post_type
*/
add_filter( 'wp_data_sync_item_request_sql_join', function( $join, $post_type ) {
global $wpdb;
if ( 'post' === $post_type ) {
$join .= "
LEFT JOIN $wpdb->term_relationships tr
ON tr.object_id = p.ID
LEFT JOIN $wpdb->term_taxonomy tt
ON tt.term_taxonomy_id = tr.term_taxonomy_id
LEFT JOIN $wpdb->terms t
ON t.term_id = tt.term_id
";
}
return $join;
}, 10, 2 );
/**
* Filter ItemRequest WHERE statement.
*
* @param string $where
* @param string $post_type
*/
add_filter( 'wp_data_sync_item_request_sql_where', function( $where, $post_type ) {
global $wpdb;
if ( 'post' === $post_type ) {
$where .= "
AND tt.taxonomy = 'category'
AND t.slug IN ('news', 'akcii')
";
}
return $where;
}, 10, 2 );
Get Started
-
Starter Plan
$39.00 / monthMore Info- 10,000 Requests/Month
- Unlimited Data Sources
- Unlimited Websites
- Unlimited Users
Basic Plan
$69.00 / monthMore Info- 40,000 Requests/Month
- Unlimited Data Sources
- Unlimited Websites
- Unlimited Users
Professional Plan
$129.00 / monthMore Info- 150,000 Requests/Month
- Unlimited Data Sources
- Unlimited Websites
- Unlimited Users
Data Source Mapping
$149.00 – $999.00More Info This product has multiple variants. The options may be chosen on the product pageLet us do the mapping for you!!We will map all your data sources for you, so you can move on to other projects that demand your time. One of our experts will map up to 50 fields for you in each data source.