Slider Revolution WP
09.06.2016
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
add_filter('essgrid_modify_posts', 'eg_mod_posts', 10, 2); function eg_mod_posts($posts, $grid_id) { // only process if Grid ID equals "1" if($grid_id == 1) { $products = array(); foreach($posts as $post) { $id = $post['ID']; $meta = get_metadata('post', $id); if($meta['_stock_status'][0] == 'instock') { $products[] = $id; } } return $products; } return $posts; } |