mirror of
https://github.com/wp-graphql/wp-graphql-woocommerce.git
synced 2026-08-14 12:53:44 +02:00
fix:$post_type must be an array when passed to in_array() (#695)
* * `$post_type` must be an array when passed to `in_array()`. * Removes unused `$post_type_obj` variable. * * Fixes tabs.
This commit is contained in:
@@ -543,6 +543,7 @@ class Products {
|
||||
* @return array Query arguments.
|
||||
*/
|
||||
public static function map_input_fields_to_wp_query( $query_args, $args, $source, $all_args, $context, $info, $post_type ) {
|
||||
$post_type = is_array( $post_type ) ? $post_type : array( $post_type );
|
||||
if ( ! in_array( 'product', $post_type, true ) && ! in_array( 'product_variation', $post_type, true ) ) {
|
||||
return $query_args;
|
||||
}
|
||||
@@ -689,7 +690,6 @@ class Products {
|
||||
}//end if
|
||||
|
||||
// Handle visibility.
|
||||
$post_type_obj = get_post_type_object( $post_type );
|
||||
if ( ! empty( $where_args['visibility'] ) ) {
|
||||
switch ( $where_args['visibility'] ) {
|
||||
case 'search':
|
||||
|
||||
Reference in New Issue
Block a user