I found the same problem. Did you ever get this resolved?
No, still haven’t.
I also encountered another strange bug about su_post.
If I get the post that is sheduled for future via ID, the shortcode returns nothing even after the sheduled post is published. I can even get the post via other calls (by tag, for example), but ID becomes unreachable.
Hope someone has the answer soon. Have the same question/problem
I have the same issue, here is the code that deals with the operators, I am working through this code to see if I can find a fix
// Code from ‘shortcodes.php’, lines 1265 – 1303
// If taxonomy attributes, create a taxonomy query
if ( !empty( $taxonomy ) && !empty( $tax_term ) ) {
// Term string to array
$tax_term = explode( ',', $tax_term );
// Validate operator
if ( !in_array( $tax_operator, array( 'IN', 'NOT IN', 'AND' ) ) ) $tax_operator = 'IN';
$tax_args = array( 'tax_query' => array( array(
'taxonomy' => $taxonomy,
'field' => ( is_numeric( $tax_term[0] ) ) ? 'id' : 'slug',
'terms' => $tax_term,
'operator' => $tax_operator ) ) );
// Check for multiple taxonomy queries
$count = 2;
$more_tax_queries = false;
while ( isset( $original_atts['taxonomy_' . $count] ) && !empty( $original_atts['taxonomy_' . $count] ) &&
isset( $original_atts['tax_' . $count . '_term'] ) &&
!empty( $original_atts['tax_' . $count . '_term'] ) ) {
// Sanitize values
$more_tax_queries = true;
$taxonomy = sanitize_key( $original_atts['taxonomy_' . $count] );
$terms = explode( ', ', sanitize_text_field( $original_atts['tax_' . $count . '_term'] ) );
$tax_operator = isset( $original_atts['tax_' . $count . '_operator'] ) ? $original_atts[
'tax_' . $count . '_operator'] : 'IN';
$tax_operator = in_array( $tax_operator, array( 'IN', 'NOT IN', 'AND' ) ) ? $tax_operator : 'IN';
$tax_args['tax_query'][] = array( 'taxonomy' => $taxonomy,
'field' => 'slug',
'terms' => $terms,
'operator' => $tax_operator );
$count++;
}
if ( $more_tax_queries ):
$tax_relation = 'AND';
if ( isset( $original_atts['tax_relation'] ) &&
in_array( $original_atts['tax_relation'], array( 'AND', 'OR' ) )
) $tax_relation = $original_atts['tax_relation'];
$args['tax_query']['relation'] = $tax_relation;
endif;
$args = array_merge( $args, $tax_args );
}
Hi, everyone!
I contacted the developer. The bug is about generating the shorcode text and it will be fixed in future version. Temporary solution is to change generated shortcode text.
Just fix text
[su_posts posts_per_page="-1" taxonomy="post_tag" tax_term="568,158" tax_operator="2"]
to
[su_posts posts_per_page="-1" taxonomy="post_tag" tax_term="568,158" tax_operator="AND"]
and it should work.