This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Register a single setting to store all of your options in the database | |
*/ | |
register_setting( 'myslug_option_group', 'myslug', 'myslug_sanitize_options_array' ); | |
/** | |
* Define each of your settings | |
*/ | |
add_settings_field( | |
'name', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
*********************************************** | |
PHP CODE (add it in your theme's functions.php)* | |
*********************************************** | |
function insert_jquery_validate(){ | |
wp_enqueue_script('validate', 'http://ajax.aspnetcdn.com/ajax/jquery.validate/1.11.1/jquery.validate.min.js', array( 'jquery' ), false, true ); | |
} | |
add_filter('wp_enqueue_scripts','insert_jquery_validate'); | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_action('plugins_loaded', function() { | |
$action = is_user_admin() ? 'user_admin_notices' : 'admin_notices'; | |
add_action($action, function () { | |
ob_start(); | |
}); | |
add_action('all_admin_notices', function () { | |
$log = strip_tags(trim(ob_get_clean())); |