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
// usage | |
// just call rekey_array_keys_to_defaults( $my_array ); | |
// this function call will return the same array in the same order | |
// but with new keys. The new keys are the default array keys | |
// i.e. [0,1,2] | |
function rekey_array_keys_to_defaults($array_to_rekey) { | |
$rekeyed_array = array(); | |
foreach ($array_to_rekey as $key => $value) { | |
array_push($rekeyed_array, $value); |
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
$ () -> #jQuery starter upper! | |
# browser window var | |
$browser_window = $(window) | |
# function | |
window_info = -> | |
console.log '----------------BROWSER WIDTH AND HEIGHT-------------------' | |
console.log $browser_window.width()+' is the browser width || '+$browser_window.height()+' is the browser height' | |
# function call | |
window_info() |
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
// get the current user name from anywhere | |
// paste into functions.php | |
if ( ! function_exists( 'get_user_name' ) ) { | |
function get_user_name() { | |
global $current_user; | |
get_currentuserinfo();//populates current user var/object | |
$current_visible_name = $current_user->user_firstname; | |
if($current_visible_name == '') { | |
$current_visible_name = $current_user->display_name; | |
}; |
NewerOlder