acfe_bidirectional_relationship breaks get_posts by meta value
-
Had to do this
<?php add_filter( 'acf/update_value', static function ( $value, $post_id, $field ) { if ( 'post_object' !== $field['type'] || 0 !== $field['multiple'] ) { return $value; } if ( is_array( $value ) || 1 === count( $value ) ) { return current( $value ); } return $value; }, 10, 3 );
Because srv/wp-content/plugins/acf-extended/includes/fields-settings/bidirectional.php:520 in
acfe_bidirectional_relationship
stores the bidirectional value as an array.
Even when no multiple values are allowed.This leads to a serialized value for meta_value in the database.
Due to the serialized value
get_post('meta_key=foo&meta_key=345')
can’t find a thing. This is what your plugin breaks – hoping for a fix soon.
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘acfe_bidirectional_relationship breaks get_posts by meta value’ is closed to new replies.