How to pass variables to custom filter from multiple functions
I think from your code add_action( ‘wp_footer’, ‘purewpns_googlefont_loader’ ); Function purewpns_googlefont_loader maybe typo mistake. You use the action wp_footer and added empty array which obviously print empty array. Okay. You can use: googlefont_filter_callback( $font ); Except $fonts = apply_filters( ‘googlefont_loader’, $fonts ); In function googlefont_loader() And add filter in function googlefont_filter_callback like: function googlefont_filter_callback( $fonts=array() … Read more