https://github.com/soderlind/mu-disable-gravatar
MU Disable Gravatar
https://github.com/soderlind/mu-disable-gravatar
Last synced: 6 months ago
JSON representation
MU Disable Gravatar
- Host: GitHub
- URL: https://github.com/soderlind/mu-disable-gravatar
- Owner: soderlind
- License: agpl-3.0
- Created: 2022-07-01T23:20:10.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2022-07-06T14:00:09.000Z (over 3 years ago)
- Last Synced: 2025-08-16T06:58:31.004Z (6 months ago)
- Language: PHP
- Size: 16.6 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Disable Gravatar
[WordPress Must-use Plugin](https://wordpress.org/support/article/must-use-plugins/) that disables Gravatar.
The plugin is simple and use the following hooks:
```php
add_filter( 'pre_get_avatar', '__return_empty_string' );
add_filter( 'get_avatar', '__return_empty_string' );
```
`pre_get_avatar`: Short circuit the Gravatar request. I.e. Stop the request to Gravatar.com.
`get_avatar`: Set the new avatar to an empty string.