Automattic\WooCommerce\Internal\Admin\ProductReviews
ReviewsListTable::review_type_dropdown()
Displays a review type drop-down for filtering reviews in the Product Reviews list table.
Method of the class: ReviewsListTable{}
Hooks from the method
Return
null
. Nothing (null).
Usage
// protected - for code of main (parent) or child class $result = $this->review_type_dropdown( $current_type ) : void;
- $current_type(string|mixed) (required)
- The current comment item type slug.
Notes
- See: WP_Comments_List_Table::comment_type_dropdown() for consistency.
ReviewsListTable::review_type_dropdown() ReviewsListTable::review type dropdown code WC 9.5.1
<?php protected function review_type_dropdown( $current_type ) : void { /** * Sets the possible options used in the Product Reviews List Table's filter-by-review-type * selector. * * @since 7.0.0 * * @param array Map of possible review types. */ $item_types = apply_filters( 'woocommerce_product_reviews_list_table_item_types', array( 'all' => __( 'All types', 'woocommerce' ), 'comment' => __( 'Replies', 'woocommerce' ), 'review' => __( 'Reviews', 'woocommerce' ), ) ); ?> <label class="screen-reader-text" for="filter-by-review-type"><?php esc_html_e( 'Filter by review type', 'woocommerce' ); ?></label> <select id="filter-by-review-type" name="review_type"> <?php foreach ( $item_types as $type => $label ) : ?> <option value="<?php echo esc_attr( $type ); ?>" <?php selected( $type, $current_type ); ?>><?php echo esc_html( $label ); ?></option> <?php endforeach; ?> </select> <?php }