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 | |
function enable_svg_upload_if_admin($mimes) { | |
$current_user_roles = wp_get_current_user()->roles; // get roles of current user | |
// check if user is administrator and user is in the admin panel (not in the frontend) | |
if(in_array('administrator', $current_user_roles) && is_admin()) { | |
$mimes['svg'] = 'image/svg+xml'; | |
return $mimes; // if administrator, enable svg upload | |
} |
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
import mandrill | |
import socket | |
REMOTE_SERVER = "www.google.com" | |
#checks if there is internet connection | |
def is_connected(): | |
try: | |
# see if we can resolve the host name -- tells us if there is | |
# a DNS listening |
NewerOlder