It’s done the same way you would do in procedural, you need to provide the priority
and the number of parameters
so you would have;
add_filter('wp_get_attachment_image_src', array($this, 'useCDN'), 10, 3);
to pass 3 additional parameters to the filter
Related Posts:
- Difference Between Filter and Action Hooks?
- How to create an API for my plugin?
- How do you use the plugin boilerplate loader class to hook actions and filters?
- How do I Make a Theme “plugin-ready”?
- Actions or filters fired when data is saved in a custom table
- 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()?
- How to add custom content under plugin row in WordPress admin plugin list?
- Define a function outside a class and call the function using action or filter hook
- Woocommerce – Hide a Column in Cart Table
- Namespaced action and filter tags
- Adding rewrite rule dynamically
- Prefixing plugin hooks (actions/filters) with a wrapper class or functions
- How to filter content for specific content variable
- Valid filenames for add_action’s first parameter
- WordPress class, using add_action to call member function does not work
- How to get all queries’s results after they have executed?
- Hook add_attachment error
- Call to undefined function is_home() or any conditional tags
- How to find list of all functions bind to a particular hook from my plugin?
- Include HTML (Bootstrap Modal Box) with a plugin into my header
- Adding tables to dashboard pages programmatically?
- apply_filters() and call_user_func() to define and call a function outside a class
- WordPress Plugin Boilerplate – add actions and/or filters based on user’s role
- WordPress Reset password Strength set to medium
- Apply function on all action hooks?
- Ninja Forms: Front-End Forms, Post ID?
- How to override existing plugin action with new action
- Which hook should be used to add an action containing a redirect?
- How to add sub-menu to a menu generated by wp_nav_menu by using plugin
- Which action for triggering cron “wp”or “init”?
- Using query_vars filter
- Explanation of the “posts_join” and “posts_fields” filter hooks?
- What’s the earliest point I can get the queried object ID?
- Is it possible to remove next-post / previous-post with out creating a custom template?
- A Post is saved twice or more during add_action(save_post)
- Proper way to use apply_filters() with class functions?
- add_filter and remove_filter added before and after wp_query
- In a plugin, why is add_action(‘init’) not executed before the plugin is activated?
- Determine which theme location a wp_get_nav_menu_items is for
- Conditional add_filter?
- How can I hook into existing WordPress Bulk actions?
- Calling apply_filters on non-documented hooks
- Odd behaviour with submenu link creation
- WordPress Media mime type filter problem 4.0
- How to allow Unfiltered HTML in a wordpress multisite install
- Is there a way to verified if an add_filter is already applied?
- Does add_filter work outside functions.php
- multiple functions with same filter
- Modifying values with add_action to be sent to db
- How to redirect to action on custom page within admin section
- Hook to get image filename when it is uploaded
- How to run an add_action hook for specific page
- Which action is triggered when a theme was modified?
- wp_transition_post_status does not change the status of the post
- Should action callbacks start with a verb?
- Execute Hook on the footer or header after activating a plugin
- Two functions utilizing registration_errors filter
- Issue plugin commands in admin settings page
- My plugin class doesn’t work! [closed]
- Is there a Filter that I can use to filter the tags before they are inserted in to the database?
- get_current_screen() return null
- add_action not calling back to function
- Tried in different ways but sidebar not working?
- conditionally load javascript & CSS for do_action() calls from plugin
- Why doesn’t my simple the_title filter get applied?
- How to filter the_content() & include content from template
- Get Time Taken By Each Action Hook in WordPress
- Search and Filter
- WordPress custom taxonomy check box to dropdown
- load_plugin_textdomain doestn’t work with add_action plugins_loaded
- What action hook can I use to add a JavaScript to a page post using a theme template that is not including get_header() nor get_footer()?
- Remove an action by extending class and replacing it
- Bind a function with its own argument to show something dynamically after every content
- Update variable value via add_filter
- Configure WordPress to Generate Scheme-less Relative URLs
- Gravity Forms Anchor only on Front Page?
- Can I Hook Into the TinyMCE Insert/Edit Link Button to Use Shortlink For Post?
- How to use add_action for multiple instances of the same class
- How do i remove the title from a specific page
- Can / should a widget plugin define its own Widget Area?
- Is there an action_filter hook to add content before the post title?
- add_filter postbox_classes multiple post types
- Override category archive page title (not the head title)
- Override woocommerce loop-start.php from theme using plugin?
- do_action from within a class does not seem to work
- Remove action added in plugin class from theme
- remove different admin menu for specific users
- Change Front page displays settings conditionally when user is online
- I have a plugin where in I have to change the title of the page dynamically by sending parameter to the_title filter
- add_option_{$option} action hook not being called
- Hook for plugin to show content for certain urls
- action callback, for action dispatched as reported by hook sniffer, not called
- WordPress permalink setting
- How can I set a dynamic value for post_updated_messages based on return value of post_updated?
- wp_mail_from not changing from address
- Sending Parameter Failed
- append code after the_content not working
- Insert plugin html content to a specific spot in the frontpage