You didn’t specify how many arguments your function accepts when you used add_filter:
add_filter( $tag, $function_to_add, $priority, $accepted_args );
Your code only passes a $tag and a $function_to_add, but it doesn’t tell WordPress what priority it should be, or how many accepted arguments your function takes. You need to fix that. If you don’t provide the 4th parameter, WordPress assumes your function only accepts 1 argument, even if you define 2 in your function ( $thumbnail and $atts ).
Also, if the filter only provides a single argument, then WordPress can’t pull a second argument out of thin air
Related Posts:
- Between functions.php (theme), widgets, and plugins, which is loaded first?
- Where do I put the code snippets I found here or somewhere else on the web?
- How do I call wp_get_current_user() in a plugin when plugins are loaded before pluggable.php?
- How to remove WPML Generator Meta Tag by theme’s functions.php (override plugin function)? [closed]
- Define Function in functions.php or plugin and call in theme loop
- Autogenerate wordpress shortcodes using array?
- How to override a theme function (within a class) using a plugin
- WooCommerce create new product and add to cart on form submit
- Change destination author link
- Shortcode under a Shortcode Multiple times Possible?
- How to call a plugin function in footer.php
- How to remove action from plugin?
- Over write plugin templates
- Override plugin functions in functions.php
- Using has_filter with a class based plugin to check whether the plugin is active or not
- How to Replace Words with Hypertext Link But Ignore Previously Existed Links?
- ajax front-end increment views on click
- Display a text message if the field is not found and not if found
- Scope for PHP Variables Assigned in functions.php or a plugin
- Override the filter from plugin in child theme
- Add a plugin before main container
- Get all categories of custom post even not assigned
- Function to prevent users from trashing comments
- How does WordPress process plugin installations?
- How to create TEMPORARY Download links in a wordpress POST?
- Conditionally add apt. Open Graph meta data to different pages on WordPress site
- plugin development: problem with functions
- Bootstrap Drop Down menu is not working
- Custom random quote widget breaks when used in multiple sidebars
- How to change constants in WordPress wp-config.php programmatically?
- Override Plugin Script Fucnction in WordPress
- How to call WordPress function other files
- Conditional attributes and logic per product category
- Disqus deleted comments are syncing with wordpress but active comments do not
- Which file of wordpress manage plugins functionalities?
- How to create an option page for this simple plugin
- What is @Action in WordPress?
- the_tags : can we insert a class
- Check if variable is set in filter
- WordPress checkbox and Illegal string offset
- Passing stored variables to add_filter
- Undefined index: action plugin problem
- PHP script from functions php is loaded via admin-ajax to div…and the result is 0, not the desired content
- JQuery prepend a function
- Adding class to last list item? Not WP generated
- I changed .live() to .on() but change is not reflected on the server
- wp_enqueue_scripts
- How can I fetch data from another website to my wordpress website with mysql database
- Send email with list of active plugins upon activation/deactivation
- how to change wp-admin url using function file
- Add the_post_thumbnail_url to a shortcode in function.php
- Changing plugin options from theme functions file?
- Expected ‘add_filter’ (T_STRING)
- Could not add ‘LoginLogout’ link using BAW login logout plugin
- My widget won’t update its values when save is clicked
- Adding a pagenavi to function for displaying bookmarks
- How do I create pages within a WordPress post?
- What is the most efficient way of adding additional functionaliy for admin only
- Error Metabox Warning: call_user_func() expects parameter 1 to be a valid callback
- Replace the_content with ACF Flexible Content via function
- Create category for each user
- RSS Feed on WordPress showing code (hypertext) in articles titles
- Alternative Hook to the_content for Changing Background Color
- Unpublished Pages Failing To Appear On Custom Path
- Post source link plugin – small modification
- Is there any way to sync Facebook Comments and with comments on WordPress website?
- Cannot pass value variable to WP AJAX functions
- Sharing varible between two add_actions
- How to create algorithm for ordering posts in WordPress?
- Easiest way to load/fire a handful of functions, IF checkbox is checked?
- Block plugin update possibilities (but not by hiding notifications)
- post id or permalink auto-incrementing number and reset everyday
- Override filter variable not working
- Soflyy WP All Import Custom File Download Issue
- Get a Taxonomy values in an array
- Shows warning when enable “wp_gallery_custom_links” plugin with Themify Builder
- WordPress environment not loading properly
- Place content inside the Post Loop
- How to replace native comment_count with Comments Evolved aggregate count
- Follow author on muti-user WordPress site
- Hook into install email
- wordpress Shortocode running twice?
- Is there any wordpress function to update a random post every 10 minutes?
- Calling an custom field from theme option at the frontend
- pluggable function in theme, to be overridden by plugin
- How to add submenu to WordPress plugin in the same Directory of main Plugin?
- Calling a function from a link in WordPress
- Saving an array to get_options
- Showing author box on post detail page
- add query string to all pages after user logged in
- Simple WordPress function / plugin to redirect a site
- Remove base from the custom post type URL [duplicate]
- is_plugin_active() not defined on active plugin, in the thumbnails.php file
- How to declare this function correctly?
- Requires PHP version 5.3.0
- PHP if url extension action=discussion condition use [closed]
- Make plugin admin page visible to other roles
- Show WooCommerce products based on query parameters on redirect
- Secure way to add JS Script to WordPress filesystem
- How to access a function declared in child theme’s functions file in a plugin file?