Proper use of Output Buffer

No, you don’t need output buffering in this case. As a rule of thumb: Don’t use output buffering unless you really have to. Just imagine what happens if someone else uses output buffering too from a plugin and it crosses with yours: // plugin ob_start(); // later, you in your theme ob_start(); // you call … Read more

How to make native video player full width?

I added this to my style.css and now the video player is fully responsive! .wp-video, video.wp-video-shortcode, .mejs-container, .mejs-overlay.load { width: 100% !important; height: 100% !important; } .mejs-container { padding-top: 56.25%; } .wp-video, video.wp-video-shortcode { max-width: 100% !important; } video.wp-video-shortcode { position: relative; } .mejs-mediaelement { position: absolute; top: 0; right: 0; bottom: 0; left: 0; … Read more

Is it possible ( or advisable) to allow open access to the new theme customizer for potential clients?

Just an idea: Make a user called ‘Guest’ and look up the user ID When redirecting your potential clients to the admin page, redirect to a script that’s logging in your clients as the guest user (Code #1) Add an WordPress action to disallow the user when logged in as ‘Guest’ and not on customize.php … Read more

WP 3.4 – what action/hook is called when theme customisation is saved?

The settings are saved via ajax, with the action customize_save. In the wp-includes/class-wp-customize-manager.php class, the callback for this ajax method is the save method (see source) This triggers the customize_save action, prior to updating each of the settings. Each setting is actually an instance of the class WP_Customize_Setting and saving the setting triggers the action … Read more

What is an alternative method to the WordPress private _doing_it_wrong() function

What is an alternative method to the WordPress private _doing_it_wrong() function? There’s no way that WordPress is ever going to get rid of the _doing_it_wrong() function, so it’s perfectly safe to use it. But if for some reason you don’t want to use it because it’s marked private, then you could create a plugin that … Read more