Filters only allow you to directly modify the first value passed to them. In your case, that’s null
. If you shifted view_slug
up a place, it would be available to filters using your events_view_html
tag.
add_filter( 'events_view_html', 'my_callback', 10, 3); // passing 3 args to the callback, assuming you need them for something.
function my_callback( $view_slug, $query, $context ) {
// Do whatever you need to do to $view_slug
// $query and $context can be read but not changed
return $view_slug;
}
Related Posts:
- Difference Between Filter and Action Hooks?
- Explanation of the “posts_join” and “posts_fields” filter hooks?
- How do you use the plugin boilerplate loader class to hook actions and filters?
- How do I Make a Theme “plugin-ready”?
- How to modify post content before writing to database?
- What’s the difference between hooks, filters and actions? [duplicate]
- How to use filter hook ‘post_updated_messages’ in coherence with action hook ‘save_post’
- Is it possible to create an action hook using do_action() within add_action()?
- Hook for post permalink update
- Dynamically Override Fancy Title
- Define a function outside a class and call the function using action or filter hook
- Synchronize Custom post type tags to WordPress default posts tags
- Woocommerce – Hide a Column in Cart Table
- WordPress after content Hook & external template part
- Namespaced action and filter tags
- best practice for query string values – get_query_var always empty for my value supplied in query string
- get_current_screen() return null
- Prefixing plugin hooks (actions/filters) with a wrapper class or functions
- WordPress custom taxonomy check box to dropdown
- How to get all queries’s results after they have executed?
- Remove an action by extending class and replacing it
- hook filter after the_content on a specific page
- Bind a function with its own argument to show something dynamically after every content
- Hook add_attachment error
- Call to undefined function is_home() or any conditional tags
- WooCommerce change Tax Class programmatically when Recalculating an existing Order [closed]
- Configure WordPress to Generate Scheme-less Relative URLs
- How to find list of all functions bind to a particular hook from my plugin?
- apply_filters() and call_user_func() to define and call a function outside a class
- Limit get_next_post to posts from the same author
- Any way, hook to add content right before the “read more” link?
- WordPress Plugin Boilerplate – add actions and/or filters based on user’s role
- Add_action not calling callback function
- How do I replace title with my plugin?
- Apply function on all action hooks?
- Ninja Forms: Front-End Forms, Post ID?
- How to create an API for my plugin?
- Admin settings update updating every time home page is hit?
- Global Objects and Public Methods
- add_filter OO with parameters
- How Can I Add a Filter to Class Instance Only?
- Does WP fire delete_post when trashed posts are automatically deleted?
- Why does do_action pass a blank string as the first parameter if no $arg is set?
- How to remove unwanted panels inside InspectorControls from core blocks in Gutenberg
- function triggered by “manage_users_custom_column” filter not working
- add_filter and remove_filter added before and after wp_query
- Some nav-menu filters do nothing
- Call activation hook multiple times
- Two-step login process – Is it possible?
- How can I hook into existing WordPress Bulk actions?
- Get returned variable from a function to add_shortcode function
- WordPress Media mime type filter problem 4.0
- How to add custom content under plugin row in WordPress admin plugin list?
- Earliest WP Hook to Safely and Reliably Redirect
- merging an array to an existing array using add_filter
- Hook into theme-switching later than `setup_theme`
- Is it possible to delay execution of shortcode output callback?
- WordPress Ajax callback function from plugin – OOP
- Why my database table not created on activation?
- Act on user meta updated, but only once
- Is there any way to allow a plugin to write over a previous version?
- How to call function at the bottom of post using plugin?
- Modifying meta tags after doing ajax call in plugin
- how to add custom functionality after woocommerce place order button
- Problems with: manage_${post_type}_posts_columns
- How To Change Logout Screen Title
- Add code inside specific wordpress standard function
- Check for template part, else filter content
- Conditional hook based on the core function that is calling it
- Replace youtube embed in wordpress
- How can I replace content in the WP Admin area before an admin page is rendered?
- How to filter content for specific content variable
- Valid filenames for add_action’s first parameter
- How dynamic action login_form_{action} is working
- How to get the post excerpt using post object?
- Odd map_meta_cap $args on post edit — sometimes integer, sometimes string
- How can I create a custom plugin that allows anonymous users to signup without registering?
- Associate multiple email addresses with the same user account, so they can log in with either
- Ajax +wordpress onClick link redirect to new page and create html content
- How to replace settings in WordPress plugin from a theme
- Adding filter to the title without affecting the menu title
- How to validate inputs with filter in register_setting callback
- How to get changed post title in my custom plug-in which fires when ‘save_post’ is called?
- Can I attach a plugin via my add_filter callback contents?
- Creating posts with links from a txt file
- Action / Hook when a new plugin is added
- Is there any way to get post meta from publish_post hook?
- Plugin Development – Call to undefined function comment_exists()
- login_message filter not working
- Prevent plugin activation and add admin notice
- get_comment_meta() for a filter hook in a plugin
- Which filter to use to pre-parse form elements, which are generated by plugin’s shortcode?
- Custom signature appears twice on page
- Does WordPress have something like timer hook?
- How to filter get_adjacent_post()?
- Can I use a hook other than ‘init’ to handle form submissions?
- Template file structure , wordpress hook for altering the template
- Looking for Hook that is fired after a plugin or wp upgrade is installed/updated
- Woocommerce: block user removing cart item
- Execute callback after REST API request completes + Response is sent