Plugin Directory

Changeset 3093936


Ignore:
Timestamp:
05/28/2024 01:04:48 PM (22 months ago)
Author:
setaryapp
Message:

Update to version 1.12.0 from GitHub

Location:
setary
Files:
6 edited
1 copied

Legend:

Unmodified
Added
Removed
  • setary/tags/1.12.0/README.md

    r3093845 r3093936  
    55Tested up to: 6.5.3
    66Requires PHP: 7.1
    7 Stable tag: 1.11.7
     7Stable tag: 1.12.0
    88License: MIT
    99License URI: https://opensource.org/licenses/MIT
     
    9090
    9191== Changelog ==
     92
     93= v1.12.0 (2024-05-28) =
     94* [new] Allow search by sku
    9295
    9396= v1.11.7 (2024-05-28) =
  • setary/tags/1.12.0/inc/class-products-with-variations.php

    r2989637 r3093936  
    777777        }
    778778
    779         add_filter('posts_join', [ $this, 'edit_posts_join' ], 10, 2);
     779        if ( ! empty( $query_args['s'] ) ) {
     780            $sku_query = "
     781                OR {$wpdb->posts}.ID IN (
     782                    SELECT DISTINCT post_id
     783                    FROM {$wpdb->postmeta}
     784                    WHERE meta_key = '_sku' AND meta_value LIKE %s
     785                )
     786                AND wp_posts.post_type IN ('product', 'product_variation')
     787                AND wp_posts.post_status NOT IN ('trash', 'auto-draft')
     788            ";
     789
     790            $search_term = '%' . $wpdb->esc_like( $query_args['s'] ) . '%';
     791            add_filter('posts_where', [ new FilterByBetween( $sku_query, [ $search_term ] ), 'filter'] );
     792        }
     793        add_filter( 'posts_join', [ $this, 'edit_posts_join' ], 10, 2 );
    780794        add_filter( 'posts_orderby', [ $this, 'edit_posts_orderby' ], 10, 2 );
    781795
  • setary/tags/1.12.0/setary.php

    r3093845 r3093936  
    1111 * Author URI:           https://setary.com/
    1212 *
    13  * Version:              1.11.7
     13 * Version:              1.12.0
    1414 * WC requires at least: 6.0.0
    1515 * WC tested up to:      8.9.1
     
    2323define( 'SETARY_PATH', \plugin_dir_path( __FILE__ ) );
    2424define( 'SETARY_URL', \plugins_url( '/', __FILE__ ) );
    25 define( 'SETARY_VERSION', '1.11.7' );
     25define( 'SETARY_VERSION', '1.12.0' );
    2626define( 'SETARY_SITE_URL', 'https://setary.com/' );
    2727define( 'SETARY_APP_URL', 'https://setary.com/app/' );
  • setary/trunk/README.md

    r3093845 r3093936  
    55Tested up to: 6.5.3
    66Requires PHP: 7.1
    7 Stable tag: 1.11.7
     7Stable tag: 1.12.0
    88License: MIT
    99License URI: https://opensource.org/licenses/MIT
     
    9090
    9191== Changelog ==
     92
     93= v1.12.0 (2024-05-28) =
     94* [new] Allow search by sku
    9295
    9396= v1.11.7 (2024-05-28) =
  • setary/trunk/inc/class-products-with-variations.php

    r2989637 r3093936  
    777777        }
    778778
    779         add_filter('posts_join', [ $this, 'edit_posts_join' ], 10, 2);
     779        if ( ! empty( $query_args['s'] ) ) {
     780            $sku_query = "
     781                OR {$wpdb->posts}.ID IN (
     782                    SELECT DISTINCT post_id
     783                    FROM {$wpdb->postmeta}
     784                    WHERE meta_key = '_sku' AND meta_value LIKE %s
     785                )
     786                AND wp_posts.post_type IN ('product', 'product_variation')
     787                AND wp_posts.post_status NOT IN ('trash', 'auto-draft')
     788            ";
     789
     790            $search_term = '%' . $wpdb->esc_like( $query_args['s'] ) . '%';
     791            add_filter('posts_where', [ new FilterByBetween( $sku_query, [ $search_term ] ), 'filter'] );
     792        }
     793        add_filter( 'posts_join', [ $this, 'edit_posts_join' ], 10, 2 );
    780794        add_filter( 'posts_orderby', [ $this, 'edit_posts_orderby' ], 10, 2 );
    781795
  • setary/trunk/setary.php

    r3093845 r3093936  
    1111 * Author URI:           https://setary.com/
    1212 *
    13  * Version:              1.11.7
     13 * Version:              1.12.0
    1414 * WC requires at least: 6.0.0
    1515 * WC tested up to:      8.9.1
     
    2323define( 'SETARY_PATH', \plugin_dir_path( __FILE__ ) );
    2424define( 'SETARY_URL', \plugins_url( '/', __FILE__ ) );
    25 define( 'SETARY_VERSION', '1.11.7' );
     25define( 'SETARY_VERSION', '1.12.0' );
    2626define( 'SETARY_SITE_URL', 'https://setary.com/' );
    2727define( 'SETARY_APP_URL', 'https://setary.com/app/' );
Note: See TracChangeset for help on using the changeset viewer.