If you want to return the data, the best solution is to use apply_filters() and instruct the callback to always return:
$output = apply_filters( 'hook_data_handle_'.$args['UID'], $args, $options );
if ( $args['echo'] )
echo $output;
else
return $output;
A less elegant solution would be to use output buffering.
Related Posts:
- How to know what functions are hooked to an action/filter?
- Implementing advanced add_* function wrappers
- How to debug removal of rewrite rule flushing?
- Is This A Correct Example Usage Of current_filter()?
- how to determine how many and what kind of arguments are passed to hooks
- Event Calendar using insert_post_data after save_post and insert_post after post_transition draft_to_schedule
- Strange behaviour with add_{$meta_type}_metadata | add_post_metadata filter
- How to access variables in the function where apply_filters() is called?
- WooCommerce: change display order of product short description and price [closed]
- Filter specific shortcode output?
- trigger save_post event programmatically
- is it possible to get the hook name in add_action?
- What hook is executed just after wp_query has been executed?
- How do I Make a Theme “plugin-ready”?
- How to disable all WordPress emails modularly and programatically?
- How to properly test a method that is called by an action hook
- Load different template file when condition met?
- Is it possible to create an action hook using do_action() within add_action()?
- Custom form action hook
- Too many actions/filters!
- How to send an automated user ‘inactivity’ email?
- Why anything done on comments_array hook gets reset?
- How To Change The Html of Products filtration sidebar in Woocommerce?
- WooCommerce – Overwrite action hook [closed]
- Admin Hook at the Login Page
- Which Hook? Hide attachments from specific post types in media library
- Reposition Woocommerce Message
- add filter login_redirect does not contain original requested redirect
- get_header and hook avoid normal call
- How to add numeric slug for child page in WordPress 5.9?
- Custom action on login and “remember me”
- How to hook into Add New Member in BuddyPress
- Filter taxonomy admin pagination
- WP action/filter to modify title before header output and article output?
- Hook when new CPT published AND postmeta inserted
- Need to check is_archive during init
- Query categories that have a description
- Gutenberg – Add align controls to a custom block
- What is the filter or hook to add admin controls to posts on the front end?
- Trying to run a compile command while saving post
- Get Time Taken By Each Action Hook in WordPress
- Add default user field to WooCommerce checkout [closed]
- Action hook for custom tax edit
- WordPress custom taxonomy check box to dropdown
- wp cron job fires at every second or so, if callback is wrapped with DOING_CRON check it never fires at all
- Trying to alter the post_content through the_post
- Remove an action by extending class and replacing it
- Insert HTML in post, below nav bar but above content?
- Convert Gravity Form Entry Date on Export
- “admin_enqueue_scripts” hook or $_GET[‘page’]?
- Pass debug_backtrace() in WordPress filter
- Redirect no product url’s to static url
- What Hook/Action is performed when a field in checkout form is changed in WooCommerce
- Add PHP code to header section from plugin
- How to change a WordPress term’s slug before saving
- dynamic add_action according to child pages (for homepage control)
- Remove action in a parent theme from the child theme
- Remove action within a class in a parent theme’s includes folder from the child theme
- Action hook save_post for newly created posts – $post object data is all empty
- What hook should I use that will fire whenever I open a post for editing in the WP back-end?
- How to access page variable inside action hook
- Can not using get_header() cause trouble (later on)?
- I need to hook and change language of facebook sdk
- Renaming wordpress login and get new password button
- Display taxonomy with a maximum number of letters
- Is there a author_update action?
- Catch and display error on save_post action
- How to set Media Box form elements default value?
- How to get product information using hooks?
- manage_shop_order_posts_custom_column() hook is Not working In Functions.php file in my WordPress active theme
- Scanning for custom embed and prefetching
- Print additional fields in wp_new_user_notification_email_admin
- Remove and replace woocommerce add to cart button [closed]
- Restricting displayed posts to posts from only select authors
- Save_post – Warning: Cannot modify header information
- Modify WordPress Page Title ()
- custom error message for empty username and password using authenticate filter not working
- remove_action not working for a function
- How can i add product Accessories from front-end using custom php form?
- Is there no concise way, a library maybe, to help with unhooking class functions and so on?
- What hook should I use to add post meta data with on update?
- Re-order search results with posts_orderby filter and post meta value
- Problem with call_user_func_array front end
- How to I prevent WordPress from switching external HTTP links to HTTPS?
- Stylesheet is getting removed/deregistered automatically
- How to override get_avatar() function?
- How to append the excerpt to the content in the single post page?
- Change user role if it’s orders count more than
- Adding Information To All Posts Screen
- Using actions, hooks and filters in a non-WordPress page
- Hook into create_category
- Trouble adding data to options table
- How to hook into publish_posttype?
- Force resize for all video content
- $GLOBALS & global doesn’t work [closed]
- Can you call a filter hook by “add_action”?
- Callback API for getting response from fygaro payment gateway
- Replace category titles inside RSS feed
- Change CPT Edit Target Link for Admin List
- Changing login url