wp_finalize_scraping_edited_file_errors

函式
wp_finalize_scraping_edited_file_errors ( $scrape_key )
引數
  • (string) $scrape_key Scrape key.
    Required:
定義位置
相關方法
wp_start_scraping_edited_file_errorswp_init_targeted_link_rel_filterswp_initialize_sitewp_admin_bar_edit_site_menuwp_make_plugin_file_tree
引入
4.9.0
棄用
-

wp_finalize_scraping_edited_file_errors。這個WordPress函式負責最終完成對有錯誤的編輯過的檔案的搜刮,這意味著它處理儲存對一個被編輯過的檔案所做的任何修改的過程,同時也記錄搜刮過程中發生的任何錯誤: 該函式需要一個引數,它是一個刮削過程中發生的錯誤陣列。如果沒有錯誤,該函式將返回null。

針對已編輯的檔案錯誤進行最終的蒐集。

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";
}

常見問題

FAQs
檢視更多 >