Inventory_Presser_Order_By_Widget::widget( array $args, array $instance )
widget
Contents
Description Description
Outputs the widget front-end HTML
Parameters Parameters
- $args
-
(array) (Required)
- $instance
-
(array) (Required)
Return Return
(void)
Source Source
File: includes/widget/class-widget-order-by.php
public function widget( $args, $instance ) { extract( $args ); $title = apply_filters( 'widget_title', ( isset( $instance['title'] ) ? $instance['title'] : '' ) ); $keys_to_list = explode( '|', $instance['post-meta-keys'] ); if ( 0 < sizeof( $keys_to_list ) ) { echo $before_widget; if ( $title ) { echo $before_title . $title . $after_title; } echo '<ul class="order-by-list list-nostyle">'; foreach ( $keys_to_list as $key ) { echo '<li><a href="javascript:order_by_post_meta(\'' . $key . '\');">' . ( isset( $instance[ 'label-' . $key ] ) ? $instance[ 'label-' . $key ] : $key ) . '</a></li>'; } echo '</ul>' . $after_widget; } }
Expand full source code Collapse full source code View on Github