Make use of unused $x var
This commit is contained in:
parent
847dea6a2d
commit
548fe93a97
|
@ -1756,17 +1756,21 @@ class WC_AJAX {
|
||||||
/**
|
/**
|
||||||
* Search for products and echo json.
|
* Search for products and echo json.
|
||||||
*
|
*
|
||||||
* @param string $x (default: '')
|
* @param string $term (default: '')
|
||||||
* @param string $post_types (default: array('product'))
|
* @param string $post_types (default: array('product'))
|
||||||
*/
|
*/
|
||||||
public static function json_search_products( $x = '', $post_types = array( 'product' ) ) {
|
public static function json_search_products( $term = '', $post_types = array( 'product' ) ) {
|
||||||
global $wpdb;
|
global $wpdb;
|
||||||
|
|
||||||
ob_start();
|
ob_start();
|
||||||
|
|
||||||
check_ajax_referer( 'search-products', 'security' );
|
check_ajax_referer( 'search-products', 'security' );
|
||||||
|
|
||||||
$term = (string) wc_clean( stripslashes( $_GET['term'] ) );
|
if ( empty( $term ) ) {
|
||||||
|
$term = wc_clean( stripslashes( $_GET['term'] ) );
|
||||||
|
} else {
|
||||||
|
$term = wc_clean( $term );
|
||||||
|
}
|
||||||
|
|
||||||
if ( empty( $term ) ) {
|
if ( empty( $term ) ) {
|
||||||
die();
|
die();
|
||||||
|
|
Loading…
Reference in New Issue