How to prevent escaping when saving HTML code in an option value?
stripslashes(wp_filter_post_kses(addslashes($_POST[‘sidebar_code’]))); but you should know that the kses filter is not 100% safe.
stripslashes(wp_filter_post_kses(addslashes($_POST[‘sidebar_code’]))); but you should know that the kses filter is not 100% safe.
Here’s an example; First to figure out the order of the sub menu items based upon its array key you can do a var_dump on the $submenu global variable which will output the following; (I’m using the Posts menu and sub menu as an example) //shortened for brevity…. [“edit.php”]=> array(6) { [5]=> array(3) { [0]=> … Read more
Re-size WordPress images on the fly using built-in WordPress functions. Use the vt_resize function to dynamically re-size WordPress images located in a custom field, featured image, uploads directory, NextGen Gallery WordPress plugin, or even an external link to an offsite image. It is very simple to use, just copy/paste the code below into your WordPress … Read more
The answer that yes, the theme_mod functions will be slower, but not significantly, and the benefits outweigh the differences. Theme mods are stored as options. So, in essence, the theme_mod functions are wrappers around the options functions. First, understand that theme_mod settings are stored as an array in a single option, keyed to the specific … Read more