'widget-categories widget_custom_categories', 'description' => __( 'Display Custom Categories.', 'becommerce-store' ) ); // Create the widget. parent::__construct( 'custom_categories', // $this->id_base __( '» BeCommerce Custom Categories', 'becommerce-store' ), // $this->name $becommerce_store_widget_options // $this->becommerce_store_widget_options ); } /** * Outputs the widget based on the arguments input through the widget controls. * * @since 1.0.0 */ function widget( $args, $instance ) { extract( $args ); // Output the theme's $before_widget wrapper. echo $before_widget; $instance = wp_parse_args( $instance, array( 'title' => '', 'orderby' => 'count', 'order' => 'desc', 'depth' => '1', 'show_count' => 0, 'item_per_row' => 2, ) ); echo $before_title; echo empty( $instance['title'] ) ? _e( 'Categories', 'becommerce-store' ) : apply_filters( 'widget_title', $instance['title'] ); echo $after_title; $_args = array( 'show_option_all' => '', 'orderby' => 'name', 'order' => 'ASC', 'style' => 'list', 'show_count' => 1, 'hide_empty' => 0, 'use_desc_for_title' => 1, 'child_of' => 0, 'feed' => '', 'feed_type' => '', 'feed_image' => '', 'exclude' => '', 'exclude_tree' => '', 'include' => '', 'hierarchical' => 1, 'title_li' => false, 'show_option_none' => false, 'echo' => 1, 'depth' => 1, 'current_category' => 0, 'pad_counts' => 0, 'walker' => new becommerce_store_Walker_Category() ); $_args = wp_parse_args( $instance , $_args ); ?>
0 - ' . esc_html__( 'All Categories and child Categories', 'becommerce-store' ),
'-1' => '-1 -' . esc_html__('All Categories displayed in flat (no indent) form (overrides hierarchical)', 'becommerce-store' ),
'1' => '1 - ' . esc_html__( 'Show only top level Categories', 'becommerce-store' ),
'n' => 'n - ' . esc_html__( 'Value of n (a number) specifies the depth (or level) to descend in displaying Categories', 'becommerce-store' ),
);
?>
", $depth ); ?>
id="get_field_id( 'show_count' ); ?>" name="get_field_name( 'show_count' ); ?>" type="checkbox" value="1">
name ), $category ); // Don't generate an element if the category name is empty. if ( ! $cat_name ) { return; } $link = 'description ) ) { /** * Filter the category description for display. * * @since 1.2.0 * * @param string $description Category description. * @param object $category Category object. */ $link .= 'title="' . esc_attr( strip_tags( apply_filters( 'category_description', $category->description, $category ) ) ) . '"'; } $link .= '>'; $link .= $cat_name . ''; if ( ! empty( $args['show_count'] ) ) { $link .= ' (' . number_format_i18n( $category->count ) . ') '; } if ( 'list' == $args['style'] ) { $output .= "\t