Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adjust the documentation for ep_woocommerce_admin_products_list_search_fields #3124

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 13 additions & 4 deletions includes/classes/Feature/WooCommerce/WooCommerce.php
Original file line number Diff line number Diff line change
Expand Up @@ -1058,13 +1058,22 @@ public function translate_args_admin_products_list( $query ) {
$query->set( 's', sanitize_text_field( $search_term ) ); // phpcs:ignore WordPress.Security.NonceVerification

/**
* Filter to skip integration with WooCommerce Admin Product List.
* Filter the fields used in WooCommerce Admin Product Search.
*
* ```
* add_filter(
* 'ep_woocommerce_admin_products_list_search_fields',
* function ( $wc_admin_search_fields ) {
* $wc_admin_search_fields['meta'][] = 'custom_field';
* return $wc_admin_search_fields;
* }
* );
* ```
*
* @hook ep_woocommerce_admin_products_list_search_fields
* @since 4.2.0
* @param {bool} $integrate True to integrate, false to preserve original behavior. Defaults to true.
* @param {array} $query_vars Query vars.
* @return {bool} New integrate value
* @param {array} $wc_admin_search_fields Fields to be used in the WooCommerce Admin Product Search
* @return {array} New fields
*/
$search_fields = apply_filters(
'ep_woocommerce_admin_products_list_search_fields',
Expand Down