You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
…will never display the image path set via the filter using $args['default']. It will always fall back to get_option('avatar_default') unless $default is provided from the template.
Steps to reproduce behavior
Activate the Timber starter theme.
Add the Twig snippet above to the theme's templates/comment.twig.
Add the PHP snippet above to the theme's functions.php or to a new plugin.
Navigate to wp-admin/options-discussion.php and scroll to the "Default avatar" section. All default avatars should display the image path provided in the PHP snippet.
Navigate to a post containing comments with a default image visible. Observe that the image displayed does not match what was defined in the filter.
What version of WordPress, PHP and Timber are you using?
WordPress 5.7.2
PHP 7.4.1
Timber 1.18.2
How did you install Timber? (for example, from GitHub, Composer/Packagist, WP.org?)
Expected behavior
If you want to customize the default avatar in WordPress from a plugin or theme, normally you'd do so via one of the avatar filters like so:
In which case any request for a Gravatar that does not exist will instead display our custom default image:
This functionality is helpful in cases where we want to extend WordPress's default avatar functionality dynamically via a plugin.
Actual behavior
In Timber, the following code in the context of a post comment…
…will never display the image path set via the filter using
$args['default']
. It will always fall back toget_option('avatar_default')
unless$default
is provided from the template.Steps to reproduce behavior
templates/comment.twig
.functions.php
or to a new plugin.wp-admin/options-discussion.php
and scroll to the "Default avatar" section. All default avatars should display the image path provided in the PHP snippet.What version of WordPress, PHP and Timber are you using?
How did you install Timber? (for example, from GitHub, Composer/Packagist, WP.org?)
The text was updated successfully, but these errors were encountered: