Tag: filter-hook
-
Stop WordPress From Sending Emails (And Log Them Too!)
A plugin that blocks emails for certain users and logs all email attempts in WordPress.
-
Silly Ideas: Cache WordPress Excerpts
in WordPressLet’s explore dumb ideas around caching parts of WordPress we shouldn’t.
-
Half Baked Idea: Limiting WordPress Image Upload Sizes
in WordPressLimit image upload size in WordPress media library by using the `wp_handle_upload_prefilter` filter. Implement a custom function to check and restrict the size of uploaded images. Utilize PHP code to set a maximum size limit and display an error message if the file exceeds it. Add this functionality to your WordPress site.
-
Quick Tip: Script Debugging in WordPress
in WordPressWhen debugging core WordPress scripts, dealing with cached copies like in `script-loader.php` can be tricky. You can apply a unique `ver` argument to core scripts on each refresh using a filter. This ensures you get the most recent version from page and browser cache. Remember to enable `SCRIPT_DEBUG` when debugging core scripts.
-
Logging Failed Redirects
in WordPressA logging plugin can help track failed redirects in WordPress, preventing default redirects to “/wp-admin/” for un-whitelisted domains. The plugin creates a dashboard widget displaying domains and failed redirect counts, offering insight into redirect issues and simplifying troubleshooting.
-
Quick Tip: Force Enable Auto-Updates in WordPress
in WordPressEnable auto-updates for WordPress core, plugins, themes, and translations using an mu-plugin with PHP code. Embrace auto-updates for smoother maintenance.
-
Disabling plugin deactivation in WordPress
The problem came up recently about how to make sure plugins activated in the WordPress plugin UI don’t get deactivated if they are necessary for a site to function. I thought that was an interesting thought puzzle worth spending 15 minutes on, so I came up with this function as a solution: Which can be…