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() ) {
return apply_filters( 'googlefont_loader', $fonts );
}
Now you’ll be able to access fonts from both short code.
E.g.
add_filter( 'googlefont_loader' function( $fonts ) {
var_dump( $fonts);
return $fonts;
});
But it affect on both short code. You can introduce another individual filters for each shortcode.
Related Posts:
- Shortcodes — Using add_action, add_filter in the shortcode
- add_action(), add_filter() before or after function
- apply_filters(‘the_content’, $content) vs do_shortcode($content)
- Trouble understanding apply_filters()
- What is the very earliest action hook you can call?
- wp_headers vs send_headers. When to use each?
- How to get shortcode’s input values inside a filter?
- How many filter/action hooks are healthy?
- Filter specific shortcode output?
- Earliest hook to reliably get $post/$posts
- Remove Editor From Homepage
- What does (10, 2) mean when used with add_filter
- Valid characters for actions, hooks and filters
- Advanced Custom Fields and Yoast SEO keyword analysis [closed]
- Insert Custom HTML After Shortcode
- Is there a way to add another row to the tinyMCE kitchen sink toggle?
- How to check if a hook is hooked or not?
- Is it possible to use object in add_action?
- add_filter and changing output captions of image gallery
- Store source permalink on XMLRPC calls
- How to make post and comment count unclickable with dashboard_glance_items hook
- How to add attribute to output with wp_video_shortcode add_filter
- Hook into admin post list page
- Anyway to edit the titlebar of WordPress Widgets in the Admin area?
- How do I know if author field was changed on post save?
- Search content for shortcodes and get parameters
- Change default settings used by gallery shortcode
- Using hooks to place content in theme dynamically
- About Hooks and Filters
- Shortcodes not resolved in AJAX call response
- PHP5, Inheritance, Singleton – action & filter hook limitations
- Ajax, filters and shortcodes
- Should I use add_action(‘publish_post or add_filter(‘publish_post?
- Please explain me what the do_action does
- Format content value from DB outside of WordPress filters
- Apply the_title filter to post titles AND backend auto social-sharing plugin, but not nav menu
- Use content custom filter for all shortcodes
- add_action uses ‘echo’ add_filter uses ‘return’, why?
- How to link current user to their author page through shortcodes
- changing variable through filters or action hooks
- filter title from shortcode
- Too many actions/filters!
- how to remove filter from wordpress shortcode output
- Apply a filter only once
- How to get list of all hooks of current theme / plugin?
- Making a class available via actions filters
- How does WordPress call functions attached to a certain action hook before calling functions attached to other hooks
- How to get current action?
- Conditionally call add_action depending on post_type?
- how to change appearence of the content of default post list columns?
- Anonymous function is executed twice in wp_head while added from the_posts filter?
- Explanation for remove_filter used in the below code [closed]
- How to change the blog title with add_filter? details below
- Error when overriding only some audio shortcode HTML output
- How To Get User Data in Callback Function for pre_user_nicename?
- What’s the best way to split admin-only functionality in the theme’s functions.php file?
- Filter list by a unique meta value dilemma
- How to use shortcode attribute in separate function
- return values from hooks do_action and apply_filters, which is better
- How to get all the predefined do_action() calls from an active theme
- Is it possible to track down Actions and Filters?
- When to use actions and when to use filters
- Return a custom value in a function added to an action hook
- Is possible dequeue/remove style from wp_footer() hook and add on wp_head() hook?
- Same Conditionals Not Working on Two Different Hooks
- How to call a function or method that is Namespaced using another plugin
- How to change currency programmatically on creating order action?
- add filter login_redirect does not contain original requested redirect
- get_header and hook avoid normal call
- Removing an action, or dequeueing style – Both not working
- Can the wp_filter object hold multiple values with the same key
- How to change the order (priority) of registered filters (or actions) (e.g. for the_content)?
- apply_filters/do_action tag characters limit
- Replace a word with a word in the URL string
- Is there a filter called ‘network_admin_init’?
- How to add ‘total’ value to custom column title on the posts list page
- Filter taxonomy admin pagination
- When to use add_action when registering/enqueuing scripts
- Insert term when page is published – avoid duplicates after edits
- Are there actions or filters I can use for Ajax calls?
- Capture post content before page renders
- Correct method of redirecting user login
- How to remove action with slashes and arrows?
- Can the wordpress color palettes by changed through Javascript?
- How do I use remove_action on an add_action that uses an array?
- How to properly modify WP Vary or any existing headers?
- Changing WordPress core without hacking core
- Building a request processor for multi-page forms, etc using $_GET requests
- Comment search plugin
- How to customize the “Insert/edit link” popup box?
- How to filter backend post list showing only posts having a shortcode
- Proper after_setup_theme and wp_head cleanup
- How to get a single hook from wp_head()?
- How can I output all apply_filters and do_action?
- How to allow code block in wordpress comments
- Add a filter inside an action init
- How can I return shortcode output to the top of the content?
- remove_action: how to access to a method in an child class?
- Is it possible to apply_filter on a wp_ajax_ action?
- the_excerpt filter doesn’t work as expected