
Regenerate WordPress media image sizes, programmatically
25/02/2021Learn how to regenerate and update WordPress media and image sizes both programmatically (without plugin), and also with a handy plugin.
In JavaScript it is possible to call a function using a string. All you need to know is the object the function resides in and the name of the function as a string.
You could do this using eval(), but apparently it is a big ‘no-no’ for security reasons. Here is a safer approach:
function dave(message) {
alert(message);
}
// object[functionString](args)
window['dave']('hello');
Clean and simple, without opening eval(“Pandora’s Box”).
Learn how to regenerate and update WordPress media and image sizes both programmatically (without plugin), and also with a handy plugin.
Need to find a directory path relative to your current file? This is how we use dirname() and realpath() to move up directory levels in PHP.
Ever seen constants like __DIR__ and __FILE__ being used in PHP? These are 'Magic Constants', and this is how we can use them.
What are web components? Learn about web components, the shadow DOM, styling and lifecycle callbacks in this JavaScript tutorial series.
Learn how to use event listeners to detect and handle single and multiple keypress events in JavaScript. Add modifier keys to your application!
Using Bulma but don't know how to integrate it with Nuxt? I'll show you how to load Bulma into your Nuxt project with full control over variables.