Automatic switch to backup database on fail

HyperDB is awesome. You shouldn’t worry about its dev date (which by the way, its being done by Automattic – the team behind WordPress). HyperDB has some bigger advantages like spreading read/writes across servers and splitting them and its mostly used for such purposes (bigger scales). In your case, I would go for a VIP … Read more

How to set taxonomy in custom plugin?

You might need to resave your permalinks. Just press the Save button on the permalink settings: /wp-admin/options-permalink.php Otherwise, your code works after cleaning up just a couple of typos: function post_type_questionnaire() { $labels = array( ‘name’ => _x(‘Questionnaire’, ‘post type general name’), ‘singular_name’ => _x(‘Questionnaire’, ‘post type singular name’), ‘add_new’ => _x(‘Add New Question’, ‘questionnaire’), … Read more

WordPress stripping away backslashes from HTML

esc_js() is used to escape single quotes, htmlspecialchar ” < > &, and fix line endings; it takes only a single required parameter as a string: the text to be escaped, and returns an escaped text. It is intended to be used for inline JavaScript such as the onclick=”” attribute (note that the strings have … Read more