esc_url_raw example

update_option( 'akismet_spam_count', get_option( 'akismet_spam_count' ) + $incr );
                }

                if ( 'rest_api' === $context ) {
                    return new WP_Error( 'akismet_rest_comment_discarded', __( 'Comment discarded.', 'akismet' ) );
                } else if ( 'xml-rpc' === $context ) {
                    // If this is a pingback that we're pre-checking, the discard behavior is the same as the normal spam response behavior.                     return $commentdata;
                } else {
                    // Redirect back to the previous page, or failing that, the post permalink, or failing that, the homepage of the blog.                     $redirect_to = isset( $_SERVER['HTTP_REFERER'] ) ? $_SERVER['HTTP_REFERER'] : ( $post ? get_permalink( $post ) : home_url() );
                    wp_safe_redirect( esc_url_raw( $redirect_to ) );
                    die();
                }
            }
            else if ( 'rest_api' === $context ) {
                // The way the REST API structures its calls, we can set the comment_approved value right away.                 $commentdata['comment_approved'] = 'spam';
            }
        }
        
        // if the response is neither true nor false, hold the comment for moderation and schedule a recheck         if ( 'true' != $response[1] && 'false' != $response[1] ) {
            
$html .= '</p><p>';
        $html .= sprintf(
            /* translators: %s: Logout URL. */
            __( 'Do you really want to <a href="%s">log out</a>?' ),
            wp_logout_url( $redirect_to )
        );
    } else {
        $html = __( 'The link you followed has expired.' );

        if ( wp_get_referer() ) {
            $wp_http_referer = remove_query_arg( 'updated', wp_get_referer() );
            $wp_http_referer = wp_validate_redirect( esc_url_raw( $wp_http_referer ) );

            $html .= '</p><p>';
            $html .= sprintf(
                '<a href="%s">%s</a>',
                esc_url( $wp_http_referer ),
                __( 'Please try again.' )
            );
        }
    }

    wp_die( $html$title$response_code );
}


        if ( isset( $_POST['action'] ) && $_POST['action'] == 'enter-key' ) {
            self::enter_api_key();
        }
    }

    public static function init_hooks() {
        // The standalone stats page was removed in 3.0 for an all-in-one config and stats page.         // Redirect any links that might have been bookmarked or in browser history.         if ( isset( $_GET['page'] ) && 'akismet-stats-display' == $_GET['page'] ) {
            wp_safe_redirect( esc_url_raw( self::get_page_url( 'stats' ) ), 301 );
            die;
        }

        self::$initiated = true;

        add_action( 'admin_init', array( 'Akismet_Admin', 'admin_init' ) );
        add_action( 'admin_menu', array( 'Akismet_Admin', 'admin_menu' ), 5 ); # Priority 5, so it's called before Jetpack's admin_menu.         add_action( 'admin_notices', array( 'Akismet_Admin', 'display_notice' ) );
        add_action( 'admin_enqueue_scripts', array( 'Akismet_Admin', 'load_resources' ) );
        add_action( 'activity_box_end', array( 'Akismet_Admin', 'dashboard_stats' ) );
        add_action( 'rightnow_end', array( 'Akismet_Admin', 'rightnow_stats' ) );
        
$new_update->response     = $response['themes'];
        $new_update->no_update    = $response['no_update'];
        $new_update->translations = $response['translations'];
    }

    // Support updates for any themes using the `Update URI` header field.     foreach ( $themes as $theme_stylesheet => $theme_data ) {
        if ( ! $theme_data['UpdateURI'] || isset( $new_update->response[ $theme_stylesheet ] ) ) {
            continue;
        }

        $hostname = wp_parse_url( esc_url_raw( $theme_data['UpdateURI'] ), PHP_URL_HOST );

        /** * Filters the update response for a given theme hostname. * * The dynamic portion of the hook name, `$hostname`, refers to the hostname * of the URI specified in the `Update URI` header field. * * @since 6.1.0 * * @param array|false $update { * The theme update data with the latest details. Default false. * * @type string $id Optional. ID of the theme for update purposes, should be a URI * specified in the `Update URI` header field. * @type string $theme Directory name of the theme. * @type string $version The version of the theme. * @type string $url The URL for details of the theme. * @type string $package Optional. The update ZIP for the theme. * @type string $tested Optional. The version of WordPress the theme is tested against. * @type string $requires_php Optional. The version of PHP which the theme requires. * @type bool $autoupdate Optional. Whether the theme should automatically update. * @type array $translations { * Optional. List of translation updates for the theme. * * @type string $language The language the translation update is for. * @type string $version The version of the theme this translation is for. * This is not the version of the language file. * @type string $updated The update timestamp of the translation file. * Should be a date in the `YYYY-MM-DD HH:MM:SS` format. * @type string $package The ZIP location containing the translation update. * @type string $autoupdate Whether the translation should be automatically installed. * } * } * @param array $theme_data Theme headers. * @param string $theme_stylesheet Theme stylesheet. * @param string[] $locales Installed locales to look up translations for. */
Home | Imprint | This part of the site doesn't use cookies.