While your answer is very interesting and I like it, I still want to post another proposal, just let you have another choice 🙂
IMHO, if the data contains only simple fields, like:
array(
'name' => 'my name',
'address' => 'my address',
'phone' => '01234',
);
then you can use the code below:
add_filter( 'wpse63692_example_filter', 'wpse63692_example_cb' );
function wpse63692_example_cb( $data )
{
foreach ( $data as $key => $value )
{
// Recursively apply filters to sub array
if ( is_array( $value ) )
$data[$key] = apply_filters( current_filter(), $value );
}
// Do something with $data
return $data;
}
Related Posts:
- Filter Hook callback error, is it due to using $this inside a filter or something else?
- How To Override A WooCommerce AJAX Function
- Problem with Class, Filters and Callbacks
- Plugin default settings hook
- add_action(), add_filter() before or after function
- Remove classes from body_class
- wp_headers vs send_headers. When to use each?
- Filter any HTTP request URI?
- Is it possible to filter comments in a post so a user can only see the comments they have written?
- Where to hook into post content?
- What hook do I use to edit the post statuses option in admin?
- Check if a filter or function has been already been called
- Custom Rewrite Rules Not Sticking
- Filter Widget Title Wrap
- Customizing WordPress the_title with add_filter
- How can I send data to admin-ajax via JS Fetch?
- Disable resizing of gif when uploaded
- How to change Woocommerce breadcrumbs content?
- Detecting Embed URLs Within post_content
- I’m using a filter to remove the tags auto wrap, but there still wrapped elements?
- How to enable visual editor when editing comments on the dashboard?
- Format content value from DB outside of WordPress filters
- Can’t change the title tag with wp_title filter
- How to filter ‘post_gallery’ after all other filters/plugins etc
- Can’t get wp_title filter working in twenty sixteen child theme
- add_action uses ‘echo’ add_filter uses ‘return’, why?
- Cron schedule interval through plugin options?
- wpmu_signup_user_notification filter not working
- Filter oembeds tags to modify iframe attributes
- Removing labels and tag on WordPress’s default login form
- How to check a filter are applied
- How do I add a listbox to the TinyMCE editor?
- How to remove google font in WordPress for only single page?
- Overwrite default WordPress wording
- Why anything done on comments_array hook gets reset?
- Using ‘posts_where’ on a query with a custom field
- Wrap h1-h6 in a div
- add filter login_redirect does not contain original requested redirect
- get_header and hook avoid normal call
- Dropdown filter in custom posts
- Custom Login Errors and variables I can use
- How to order by taxonomy using wp_query
- Filter taxonomy admin pagination
- Feed, RSS not able to clear the cache and cannot change the limit of cache life time
- WP action/filter to modify title before header output and article output?
- Custom view counts not updating correctly
- WP Filter to change the URL of an Anchor wrapping the last gallery image
- Gutenberg – Add align controls to a custom block
- To add a custom filter based on a meta field
- I can not include page to wordpress function add_filter, the_content
- How to create Woocommerce Product Filter Widget [closed]
- Add default user field to WooCommerce checkout [closed]
- Filtering Comment Reply Links (comment_reply_link_args) for “infinite replies” in nested comments
- Create Search Form to Filter Through Terms
- Disadvantage of using filters & hooks multiple times
- Can I override the content array using the_posts filter?
- Admin post list – adding an option to the date filter dropdown
- Use of comment_reply_link_args filter
- How to use do_shortcode_tag to modify the output of a shortcode?
- Shortcodes within the sidebar text/html widget: How to preserve the raw HTML output of the shortcode?
- Get The Caller (Plugin / Theme / Core) For All actions & Hook in WordPress
- How to trim white space in search terms?
- Changing the argument of a function
- Alter existing page contents based on url
- How to include add_filter() in a condition based on $post data
- Admin: how to make a custom list filter button send GET queryvars
- Remove pretty photo style and script if not exist!
- custom gallery filter with image caption as link title?
- Is this hook really deprecated? ( manage_{$taxonomy}_custom_column )
- arguments for comment_notification_text filter
- Add_filter rel=”prettyphoto” to WP3.4.1
- How can i filter wordpress users by custom feild?
- The gettext hook doesnt work on text with links
- the_content getting current page content instead specified ID
- How to redirect a unique link based on login status
- “The editor has encountered an unexpected error” After add defer tag to java script
- Hook to add content after date in post?
- Create different flavours of excerpt
- Is it possible to assign a css id to a row in plugins list table?
- Search with filters
- filter out
- Dealing with the clickTrack event in wp-playlist.js in order to display audio download link on the playlist title row
- How do I isolate the reason a wordpress filter is not running?
- How to remove the post pagination (Next page tag) depending on type of traffic source: from utm_campain or non-utm_campain
- How do I disable the warning “The backup of this post in your browser is different from the version below”?
- Change url to posts if they have custom tax only
- How to get to the date of the uploaded file
- Publish button inside custom field group
- Custom search fields and AJAX support
- Can’t get content of all (19) posts – Incomplete Chunked Encoding
- Customize register form page with add_action or apply_filter
- How to separate a specific page’s comments from other comments
- Replace image scr with it’s surrounding href
- Woocommerce: Only one review per verified buyer [closed]
- str_replace css meta tag?
- How to elect position of new item output in a dropdown when using add_filter
- Query Multiple Filters, one with Meta
- How to remove a filter that is an object method?
- Filter a custom post type by custom field in admin
- Search and Filter Using Custom Post Type, Custom Taxonomy, and Advanced Custom Fields