get_allowed_http_origins

The timeline below displays how wordpress function get_allowed_http_origins has changed across different WordPress versions. If a version is not listed, refer to the next available version below.

WordPress Version: 5.4

/**
 * Retrieve list of allowed HTTP origins.
 *
 * @since 3.4.0
 *
 * @return string[] Array of origin URLs.
 */
function get_allowed_http_origins()
{
    $admin_origin = parse_url(admin_url());
    $home_origin = parse_url(home_url());
    // @todo Preserve port?
    $allowed_origins = array_unique(array('http://' . $admin_origin['host'], 'https://' . $admin_origin['host'], 'http://' . $home_origin['host'], 'https://' . $home_origin['host']));
    /**
     * Change the origin types allowed for HTTP requests.
     *
     * @since 3.4.0
     *
     * @param string[] $allowed_origins {
     *     Array of default allowed HTTP origins.
     *
     *     @type string $0 Non-secure URL for admin origin.
     *     @type string $1 Secure URL for admin origin.
     *     @type string $2 Non-secure URL for home origin.
     *     @type string $3 Secure URL for home origin.
     * }
     */
    return apply_filters('allowed_http_origins', $allowed_origins);
}

WordPress Version: 5.3

/**
 * Retrieve list of allowed HTTP origins.
 *
 * @since 3.4.0
 *
 * @return string[] Array of origin URLs.
 */
function get_allowed_http_origins()
{
    $admin_origin = parse_url(admin_url());
    $home_origin = parse_url(home_url());
    // @todo preserve port?
    $allowed_origins = array_unique(array('http://' . $admin_origin['host'], 'https://' . $admin_origin['host'], 'http://' . $home_origin['host'], 'https://' . $home_origin['host']));
    /**
     * Change the origin types allowed for HTTP requests.
     *
     * @since 3.4.0
     *
     * @param string[] $allowed_origins {
     *     Array of default allowed HTTP origins.
     *
     *     @type string $0 Non-secure URL for admin origin.
     *     @type string $1 Secure URL for admin origin.
     *     @type string $2 Non-secure URL for home origin.
     *     @type string $3 Secure URL for home origin.
     * }
     */
    return apply_filters('allowed_http_origins', $allowed_origins);
}

WordPress Version: 3.7

/**
 * Retrieve list of allowed HTTP origins.
 *
 * @since 3.4.0
 *
 * @return array Array of origin URLs.
 */
function get_allowed_http_origins()
{
    $admin_origin = parse_url(admin_url());
    $home_origin = parse_url(home_url());
    // @todo preserve port?
    $allowed_origins = array_unique(array('http://' . $admin_origin['host'], 'https://' . $admin_origin['host'], 'http://' . $home_origin['host'], 'https://' . $home_origin['host']));
    /**
     * Change the origin types allowed for HTTP requests.
     *
     * @since 3.4.0
     *
     * @param array $allowed_origins {
     *     Default allowed HTTP origins.
     *     @type string Non-secure URL for admin origin.
     *     @type string Secure URL for admin origin.
     *     @type string Non-secure URL for home origin.
     *     @type string Secure URL for home origin.
     * }
     */
    return apply_filters('allowed_http_origins', $allowed_origins);
}