Merge branch 'master' of github.com:woocommerce/woocommerce

This commit is contained in:
Claudio Sanches 2019-06-02 18:32:56 -03:00
commit 15fa45af69
1 changed files with 16 additions and 6 deletions

View File

@ -1544,12 +1544,22 @@ class WC_Product_Data_Store_CPT extends WC_Data_Store_WP implements WC_Object_Da
} }
$post_types = $include_variations ? array( 'product', 'product_variation' ) : array( 'product' ); $post_types = $include_variations ? array( 'product', 'product_variation' ) : array( 'product' );
$post_statuses = current_user_can( 'edit_private_products' ) ? array( 'private', 'publish' ) : array( 'publish' );
$type_where = ''; $type_where = '';
$status_where = ''; $status_where = '';
$limit_query = ''; $limit_query = '';
$term = wc_strtolower( $term ); $term = wc_strtolower( $term );
/**
* Hook woocommerce_search_products_post_statuses.
*
* @since 3.7.0
* @param array $post_statuses List of post statuses.
*/
$post_statuses = apply_filters(
'woocommerce_search_products_post_statuses',
current_user_can( 'edit_private_products' ) ? array( 'private', 'publish' ) : array( 'publish' )
);
// See if search term contains OR keywords. // See if search term contains OR keywords.
if ( strstr( $term, ' or ' ) ) { if ( strstr( $term, ' or ' ) ) {
$term_groups = explode( ' or ', $term ); $term_groups = explode( ' or ', $term );