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?
- Is there a way to send HTML formatted emails with WordPress’ wp_mail() function?
- Passing a parameter to filter and action functions
- How to get WordPress’ hooks/actions run sequence?
- Difference Between Filter and Action Hooks?
- Where can I find a list of WordPress hooks?
- Is there a save_post hook for custom post types?
- Where is the right place to register/enqueue scripts & styles
- Get a list of all registered actions
- How to hook update_post_meta and delete_post_meta?
- WordPress hooks/filters insert before content or after title
- Are there any hooks that alter the 404 logic?
- Is there a hook that runs after a user logs in?
- How can I edit post data before it is saved?
- Difference between do_action and add_action
- How do filters and hooks really work in PHP
- Trouble understanding apply_filters()
- WP Cron Doesn’t Execute When Time Elapses
- WooCommerce: change display order of product short description and price [closed]
- Why do some hooks not work inside class context?
- Issues with title-tag and document_title_parts
- Difference between after_setup_theme and init action hooks?
- get $post in init filter or action?
- Use wp init hook to call other hooks?
- How many times can I hook into the same action?
- How do I implement the WordPress Iris picker into my plugin on the front-end?
- How to intercept a 404 error
- Move excerpt meta box to above content editor
- Is there any action filter/hook for validating a custom field before publishing the post?
- Action hook for custom tax edit
- Trigger custom action when setting button pressed
- What is “all” in isset($wp_filter[‘all’])
- Whats worth using add_action when we can simply use add_filter?
- Is there a limit to hook priority?
- Please explain how these hooks work
- How many filter/action hooks are healthy?
- Filter specific shortcode output?
- Earliest hook to reliably get $post/$posts
- Add_action to wp_head via functions.php
- How to pass/get data to/from the WooCommerce data-product_variations object?
- Hook after image is uploaded and image sizes generated
- Where to hook into post content?
- Is there a hook before the user is authenticated?
- What does (10, 2) mean when used with add_filter
- How to remove the Theme Customization Button from the dashboard and themes options page?
- Hook that fires when admin setting is saved
- Define custom Page Template without its own .php file
- add_action(‘wp_ajax_[action name]’, myfunction) problem
- Clarification on filters and hooks
- What is the difference between update_post_meta and update_postmeta hooks?
- How to only hook on Single.php after content?
- Hook ‘wp_enqueue_scripts’ priority has no effect
- Hook on trash post
- Hook *after* user password change?
- Auto-retrieve YouTube Image for Thumbnail?
- Which hook if user profile information is updated?
- How to remove action hook done in a plugin from functions.php in my theme?
- Valid characters for actions, hooks and filters
- How to influence the information displayed on widget inside wp-admin
- Hooks for trashing, deleting, saving, restoring custom post type
- Is there a WordPress core & plugins update action hook?
- Get old values for post before saving new ones
- How to hook into unregistering a widget instance?
- How to check if a hook is hooked or not?
- Hook into WordPress update?
- Adding a drag and drop re-ordering from a custom post type default list [closed]
- trigger save_post event programmatically
- Adding onload to body
- My add_action (wp_footer, ‘method’) is not calling?
- How To Determine If A Filter Is Called In A Sidebar/Widget Context?
- Passing Additional Parameters to add_filter Callable
- Do WordPress Core Filenames Work as Hooks?
- What is the earliest possible hook for safely using `is_front_page`?
- What hook do I use to edit the post statuses option in admin?
- switch_to_blog(): Load textdomain
- Filter hook before create order WooCommerce
- How to call a REST endpoint when a post is published?
- __NAMESPACE__ with register_activation_hook
- Modify WordPress Rest Api Request/Response
- How to add some custom HTML into wordpress admin bar?
- Can I hook inside another hook?
- Filter for “get_post_type_archive_link()”
- Adding function directly vs using hook in function.php
- Explanation of the “posts_join” and “posts_fields” filter hooks?
- Edit plugin without hooks in functions.php
- Are hooks called synchronously?
- How do you use the plugin boilerplate loader class to hook actions and filters?
- How to check if which hook triggered the call to a function?
- How can I send to multiple Contact Form 7 recipients based on form input? [closed]
- Replace Dashes Before Title in Page List
- Hook into wp_head(); in a plugin
- Custom theme hooks / filters – passing arguments
- Remove title attribute from images