WC_Widget_Brand_Description::widget()
Echoes the widget content.
Метод класса: WC_Widget_Brand_Description{}
Хуков нет.
Возвращает
null
. Ничего (null).
Использование
$WC_Widget_Brand_Description = new WC_Widget_Brand_Description(); $WC_Widget_Brand_Description->widget( $args, $instance );
- $args(массив) (обязательный)
- Display arguments including 'before_title', 'after_title', 'before_widget', and 'after_widget'.
- $instance(массив) (обязательный)
- The settings for the particular instance of the widget.
Заметки
- Смотрите: WP_Widget
Код WC_Widget_Brand_Description::widget() WC Widget Brand Description::widget WC 9.4.2
public function widget( $args, $instance ) { extract( $args ); // phpcs:ignore WordPress.PHP.DontExtract.extract_extract if ( ! is_tax( 'product_brand' ) ) { return; } if ( ! get_query_var( 'term' ) ) { return; } $thumbnail = ''; $term = get_term_by( 'slug', get_query_var( 'term' ), 'product_brand' ); $thumbnail = wc_get_brand_thumbnail_url( $term->term_id, 'large' ); echo $before_widget . $before_title . $term->name . $after_title; // phpcs:ignore WordPress.Security.EscapeOutput wc_get_template( 'widgets/brand-description.php', array( 'thumbnail' => $thumbnail, 'brand' => $term, ), 'woocommerce', WC()->plugin_path() . '/templates/brands/' ); echo $after_widget; // phpcs:ignore WordPress.Security.EscapeOutput }