This file contains 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
function get_emails_by_role($role) { | |
$arr = array(); | |
$args = array("role" => $role); | |
$users = get_users($args ); | |
foreach ($users as $key => $value) { | |
$arr[] = $value->data->user_email; | |
} |
This file contains 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
/* | |
Theme Name: ThemeName | |
Author: John Doe @ CompanyCo LTD | |
Author E-mail: john.doe@company.com | |
Author URI: http://john.company.com | |
Version: 1.0 | |
Last Update: 12/12/2012 | |
*/ |
This file contains 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
// Login Page - No logo | |
function new_custom_login_logo() { | |
echo "<style type='text/css'>h1 { display: none !important; } </style>"; | |
} | |
add_action('login_head', 'new_custom_login_logo'); |
This file contains 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
function dashboard_columns() { | |
add_screen_option( | |
'layout_columns', | |
array( | |
'max' => 4, | |
'default' => 1 | |
) | |
); | |
} | |
add_action( 'admin_head-index.php', 'dashboard_columns' ); |
This file contains 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
// Disable Theme Updates # 3.0+ | |
remove_action( 'load-update-core.php', 'wp_update_themes' ); | |
add_filter( 'pre_site_transient_update_themes', create_function( '$a', "return null;" ) ); | |
wp_clear_scheduled_hook( 'wp_update_themes' ); | |
// Disable Plugin Updates #3.0+ | |
remove_action( 'load-update-core.php', 'wp_update_plugins' ); | |
add_filter( 'pre_site_transient_update_plugins', create_function( '$a', "return null;" ) ); | |
wp_clear_scheduled_hook( 'wp_update_plugins' ); |
This file contains 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
function doStuff(flag) { | |
var deferred = $.Deferred(); | |
var err = null, | |
data = null; | |
if (flag) { | |
setTimeout(function() { | |
data = ["2", "2"]; | |
deferred.resolve(err, data); | |
}, 5 * 1000) | |
} else { |
This file contains 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
$.fn.redBorder = function () { | |
$(this).css("border", "1px solid red"); | |
return this; | |
// or shorter "return $(this).css("border", "1px solid red");" | |
}; | |
$.fn.greyBackground = function () { | |
return $(this).css("background-color", "grey"); |
This file contains 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
function fun1() { | |
setTimeout(function() { | |
console.log("fun1 after 5 s.."); | |
}, 5 * 1000); | |
return this; | |
}; | |
function fun2() { | |
setTimeout(function() { | |
console.log("fun2 after another 15 s.."); |
OlderNewer