wpto_table_query_args

apply_filters( 'wpto_table_query_args', $args, $table_ID, $atts, $column_settings, $enabled_column_array, $column_array );

To modify query arguments for products.

Parameters #

$args
Returns all the arguments
$table_ID
Table Id
$atts
Get shortcode attributes
$column_settings
Get all the column settings values.
$enabled_column_array
Get all the enabled columns as array
$column_array
Get column array

Return #

(array) Query arguments.

File Location #

includes/shortcode.php

Source Code #

View on Github.com

Example #

if( !function_exists( 'ultraaddons_table_query_args' ) ){
    
    /**
     * Here we are trying to show On backorder product by using this filter
     * 
     * Query args manipulation.
     * using Filter Hook: wpto_table_query_args
     * 
     * @param type $query_ars
     * @return Array
     */
    function ultraaddons_table_query_args( $query_ars ){

        $query_ars['meta_query'][] = array(//For Available product online
                    'key' => '_stock_status',
                    'value' => 'onbackorder'
                );
        $query_ars['meta_query']['relation'] = 'OR';
        return $query_ars;
   }
}

add_filter( 'wpto_table_query_args', 'ultraaddons_table_query_args' );