wp_finalize_scraping_edited_file_errors

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

WordPress Version: 6.3

/**
 * Finalizes scraping for edited file errors.
 *
 * @since 4.9.0
 *
 * @param string $scrape_key Scrape key.
 */
function wp_finalize_scraping_edited_file_errors($scrape_key)
{
    $error = error_get_last();
    echo "\n###### wp_scraping_result_start:{$scrape_key} ######\n";
    if (!empty($error) && in_array($error['type'], array(E_CORE_ERROR, E_COMPILE_ERROR, E_ERROR, E_PARSE, E_USER_ERROR, E_RECOVERABLE_ERROR), true)) {
        $error = str_replace(ABSPATH, '', $error);
        echo wp_json_encode($error);
    } else {
        echo wp_json_encode(true);
    }
    echo "\n###### wp_scraping_result_end:{$scrape_key} ######\n";
}

WordPress Version: 4.9

/**
 * Finalize scraping for edited file errors.
 *
 * @since 4.9.0
 *
 * @param string $scrape_key Scrape key.
 */
function wp_finalize_scraping_edited_file_errors($scrape_key)
{
    $error = error_get_last();
    echo "\n###### wp_scraping_result_start:{$scrape_key} ######\n";
    if (!empty($error) && in_array($error['type'], array(E_CORE_ERROR, E_COMPILE_ERROR, E_ERROR, E_PARSE, E_USER_ERROR, E_RECOVERABLE_ERROR), true)) {
        $error = str_replace(ABSPATH, '', $error);
        echo wp_json_encode($error);
    } else {
        echo wp_json_encode(true);
    }
    echo "\n###### wp_scraping_result_end:{$scrape_key} ######\n";
}