registered as $script ) { if ( stripos( $script->src, 'http://', 0 ) !== FALSE ) { $script->src = str_replace( 'http://', 'https://', $script->src ); } } } } } /** * force plugins to load styles with SSL if page is SSL */ function _mw_adminimize_enqueueStylesFix() { if ( ! is_admin() ) { if ( ! empty( $_SERVER[ 'HTTPS' ] ) ) { global $wp_styles; foreach ( (array) $wp_styles->registered as $script ) { if ( stripos( $script->src, 'http://', 0 ) !== FALSE ) { $script->src = str_replace( 'http://', 'https://', $script->src ); } } } } } /** * Check the role with the current user data. * * @param string $role * * @return bool */ function _mw_adminimize_current_user_has_role( $role ) { $user = wp_get_current_user(); if ( in_array( $role, (array) $user->roles ) ) { return TRUE; } return FALSE; }