Automattic\WooCommerce\Internal\Admin\ProductReviews
ReviewsListTable::product_search()
Displays a product search input for filtering reviews by product in the Product Reviews list table.
Method of the class: ReviewsListTable{}
No Hooks.
Return
null
. Nothing (null).
Usage
// protected - for code of main (parent) or child class $result = $this->product_search( ?WC_Product $current_product ) : void;
- ?WC_Product $current_product (required)
- -
ReviewsListTable::product_search() ReviewsListTable::product search code WC 9.5.1
<?php protected function product_search( ?WC_Product $current_product ) : void { ?> <label class="screen-reader-text" for="filter-by-product"><?php esc_html_e( 'Filter by product', 'woocommerce' ); ?></label> <select id="filter-by-product" class="wc-product-search" name="product_id" style="width: 200px;" data-placeholder="<?php esc_attr_e( 'Search for a product…', 'woocommerce' ); ?>" data-action="woocommerce_json_search_products" data-allow_clear="true"> <?php if ( $current_product instanceof WC_Product ) : ?> <option value="<?php echo esc_attr( $current_product->get_id() ); ?>" selected="selected"><?php echo esc_html( $current_product->get_formatted_name() ); ?></option> <?php endif; ?> </select> <?php }