• Resolved pict3000

    (@pict3000)


    In the Storefront theme I see an add_filter() call passing this in, but in what file is storefront_product_categories_args created or defined?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter pict3000

    (@pict3000)

    Trying to get my footing in filters and actions by looking for the origin of the filter hook storefront_product_categories_args from this code in themes/storefront/inc/structure/templates_tags.php:

    * Display Product Categories
    	 * Hooked into the <code>homepage</code> action in the homepage template
    	 * @since  1.0.0
    	 * @return void
    	 */
    	function storefront_product_categories( $args ) {
    
    		if ( is_woocommerce_activated() ) {
    
    			$args = apply_filters( 'storefront_product_categories_args', array(
    				'limit' 			=> 3,
    				'columns' 			=> 3,
    				'child_categories' 	=> 0,
    				'orderby' 			=> 'name',
    				'title'				=> __( 'Product Categories', 'storefront' ),
    				) );
    
    			etc...

    Where is this filter hook? A database read somewhere, right?

    Anyone know?

    James Koster

    (@jameskoster)

    That is an execution of apply_filters() which is different to add_filter(). That code is what allows you to adjust the product category arts by filtering storefront_product_categories_args.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Where is storefront_product_categories_args originated?’ is closed to new replies.