Skip to content

Commit

Permalink
Adjust feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
burhandodhy committed Jan 17, 2023
1 parent adecb83 commit 11bb1ff
Showing 1 changed file with 3 additions and 29 deletions.
32 changes: 3 additions & 29 deletions includes/classes/Feature/WooCommerce/WooCommerce.php
Original file line number Diff line number Diff line change
Expand Up @@ -144,17 +144,8 @@ public function whitelist_meta_keys( $meta, $post ) {
* @return array
*/
public function convert_post_object_to_id( $posts ) {
$new_posts = [];

foreach ( $posts as $post ) {
if ( is_object( $post ) ) {
$new_posts[] = $post->ID;
} else {
$new_posts[] = $post;
}
}

return $new_posts;
_doing_it_wrong( __METHOD__, 'This filter is removed from WooCommerce and will be removed from ElasticPress in a future release.', '4.5' );
return $posts;
}

/**
Expand Down Expand Up @@ -210,26 +201,9 @@ public function whitelist_taxonomies( $taxonomies, $post ) {
* @return array
*/
public function disallow_duplicated_query( $value, $query ) {
global $pagenow;

$searchable_post_types = $this->get_admin_searchable_post_types();

/**
* Make sure we're on edit.php in admin dashboard.
*/
if ( 'edit.php' !== $pagenow || ! is_admin() || ! in_array( $query->get( 'post_type' ), $searchable_post_types, true ) ) {
return $value;
}

/**
* Check if EP API request was already done. If request was sent return its results.
*/
if ( isset( $query->elasticsearch_success ) && $query->elasticsearch_success ) {
return $query->posts;
}
_doing_it_wrong( __METHOD__, 'This filter is removed from WooCommerce and will be removed from ElasticPress in a future release.', '4.5' );

return $value;

}

/**
Expand Down

0 comments on commit 11bb1ff

Please sign in to comment.