Automattic\WooCommerce\Internal\Admin\ProductReviews
ReviewsListTable::review_type_dropdown()
Displays a review type drop-down for filtering reviews in the Product Reviews list table.
Метод класса: ReviewsListTable{}
Хуки из метода
Возвращает
null
. Ничего.
Использование
// protected - в коде основоного (родительского) или дочернего класса $result = $this->review_type_dropdown( $current_type ) : void;
- $current_type(строка|разное) (обязательный)
- The current comment item type slug.
Заметки
- Смотрите: WP_Comments_List_Table::comment_type_dropdown() for consistency.
Код ReviewsListTable::review_type_dropdown() ReviewsListTable::review type dropdown WC 7.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 }