PHP Class WC_Widget_Layered_Nav

Inheritance: extends WP_Widget
Show file Open project: woocommerce/woocommerce Class Usage Examples

Public Methods

Method Description
__construct ( ) Constructor.
form ( array $instance ) Outputs the settings update form.
init_settings ( ) Init settings after post types are registered.
update ( array $new_instance, array $old_instance ) : array Updates a particular instance of a widget.
widget ( array $args, array $instance ) Output widget.

Protected Methods

Method Description
get_current_taxonomy ( ) : string Return the currently viewed taxonomy name.
get_current_term_id ( ) : integer Return the currently viewed term ID.
get_current_term_slug ( ) : integer Return the currently viewed term slug.
get_filtered_term_product_counts ( array $term_ids, string $taxonomy, string $query_type ) : array Count products within certain terms, taking the main WP query into consideration.
get_page_base_url ( $taxonomy ) : string Get current page URL for layered nav items.
layered_nav_dropdown ( array $terms, string $taxonomy, string $query_type ) : boolean Show dropdown layered nav.
layered_nav_list ( array $terms, string $taxonomy, string $query_type ) : boolean Show list based layered nav.

Method Details

__construct() public method

Constructor.
public __construct ( )

form() public method

Outputs the settings update form.
public form ( array $instance )
$instance array

get_current_taxonomy() protected method

Return the currently viewed taxonomy name.
protected get_current_taxonomy ( ) : string
return string

get_current_term_id() protected method

Return the currently viewed term ID.
protected get_current_term_id ( ) : integer
return integer

get_current_term_slug() protected method

Return the currently viewed term slug.
protected get_current_term_slug ( ) : integer
return integer

get_filtered_term_product_counts() protected method

Count products within certain terms, taking the main WP query into consideration.
protected get_filtered_term_product_counts ( array $term_ids, string $taxonomy, string $query_type ) : array
$term_ids array
$taxonomy string
$query_type string
return array

get_page_base_url() protected method

Get current page URL for layered nav items.
protected get_page_base_url ( $taxonomy ) : string
return string

init_settings() public method

Init settings after post types are registered.
public init_settings ( )

layered_nav_dropdown() protected method

Show dropdown layered nav.
protected layered_nav_dropdown ( array $terms, string $taxonomy, string $query_type ) : boolean
$terms array
$taxonomy string
$query_type string
return boolean Will nav display?

layered_nav_list() protected method

Show list based layered nav.
protected layered_nav_list ( array $terms, string $taxonomy, string $query_type ) : boolean
$terms array
$taxonomy string
$query_type string
return boolean Will nav display?

update() public method

Updates a particular instance of a widget.
public update ( array $new_instance, array $old_instance ) : array
$new_instance array
$old_instance array
return array

widget() public method

Output widget.
See also: WP_Widget
public widget ( array $args, array $instance )
$args array
$instance array