registered as $script ) { if ( FALSE !== stripos( $script->src, 'http://', 0 ) ) { $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() ) { return; } $https_values = array( NULL, 'off' ); if ( ! isset( $_SERVER[ 'HTTPS' ] ) || in_array( $_SERVER[ 'HTTPS' ], $https_values ) ) { return; } foreach ( (array) $GLOBALS[ 'wp_styles' ]->registered as $script ) { if ( FALSE !== stripos( $script->src, 'http://', 0 ) ) { $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; }