add_filter() inside another add_filter()
I would use do_action instead of add_filter. While similar, you are hooking into an action verse filtering a function. close, but different. function custom_get_availability( $availability, $_product ) { global $product, $bar, $progress; $stock = $product->get_total_stock(); $progress = 100-$stock; $bar = do_shortcode(‘[wp_progress_bar text=”Tickets Sold – ” pc=”.$progress.”]’); if ( $_product->is_in_stock() ) { $availability[‘availability’] = __($bar, ‘woocommerce’); … Read more