Plugin Directory

Changeset 1750656


Ignore:
Timestamp:
10/22/2017 01:28:58 PM (8 years ago)
Author:
Shellbot
Message:

Fix incompatibility with new WooCommerce visibility settings

Location:
woocommerce-auto-category-thumbnails/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • woocommerce-auto-category-thumbnails/trunk/readme.txt

    r1222531 r1750656  
    33Tags: woocommerce, ecommerce, e-commerce, wordpress ecommerce, shopping, categories
    44Requires at least: 4.0
    5 Tested up to: 4.3
     5Tested up to: 4.8.2
    66Donate link: http://patreon.com/shellbot
    77Stable tag: trunk
     
    1212
    1313== Description ==
     14
     15** 22/10/17 - Updated for the latest version of WooCommerce **
    1416
    1517By default, WooCommerce displays a neutral and uninteresting category image placeholder in those cases where a category has
     
    4648== Changelog ==
    4749
     50= 1.2 =
     51* Fixed incompatibility with latest version of WooCommerce due to changed handling of product visibility setting
     52
    4853= 1.1 =
    4954* Moved settings page to WooCommerce settings tab
  • woocommerce-auto-category-thumbnails/trunk/woocommerce-auto-cat-thumbnails.php

    r1202125 r1750656  
    44Plugin URI: http://codebyshellbot.com/wordpress-plugins/woocommerce-auto-category-thumbnails/
    55Description: Automatically display a relevant product image if category thumbnails are not set.
    6 Version: 1.1
     6Version: 1.2
    77Author: Shellbot
    88Author URI: http://codebyshellbot.com
     
    6868        //Otherwise build our query
    6969        $query_args = array(
    70             'meta_query' => array(
    71                 array(
    72                     'key' => '_visibility',
    73                     'value' => array( 'catalog', 'visible' ),
    74                     'compare' => 'IN'
    75                 )
    76             ),
    7770            'post_status' => 'publish',
    7871            'post_type' => 'product',
    7972            'posts_per_page' => 1,
    8073            'tax_query' => array(
     74                'relation' => 'AND',
    8175                array(
    8276                    'field' => 'id',
    8377                    'taxonomy' => 'product_cat',
    8478                    'terms' => $cat->term_id
    85                 )
     79                ),
     80                array(
     81                    'field' => 'slug',
     82                    'taxonomy' => 'product_visibility',
     83                    'terms' => 'exclude-from-catalog',
     84                    'operator' => 'NOT IN',
     85                ),
    8686            )
    8787        );
Note: See TracChangeset for help on using the changeset viewer.