Guest User

Untitled

a guest
Jun 6th, 2023
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.53 KB | None | 0 0
  1. if ($products->found_posts > 0) {
  2.             $products_types = array();
  3.             $products_titles = array();
  4.             wp_cache_flush();
  5.             foreach ($products->posts as $p) {
  6.                 //wp_cache_flush();
  7.                 $product_type = WC_Data_Store::load('product')->get_product_type($p->ID);
  8.                 $res['data'][] = $this->_pack_row($p, $product_type);
  9.                 $products_types[$p->ID] = $product_type;
  10.                 $products_titles[$p->ID] = str_replace('"', "", str_replace("'", "", $p->post_title));
Advertisement
Add Comment
Please, Sign In to add comment