wp_should_handle_php_error

過濾鉤子
apply_filters( 'wp_should_handle_php_error', false, $error )
引數
  • (bool) $should_handle_error Whether the error should be handled by the fatal error handler.
    Required:
  • (array) $error Error information retrieved from `error_get_last()`.
    Required:
定義位置
相關勾子
wp_handle_uploadwp_php_error_argswp_should_replace_insecure_home_urlwp_audio_embed_handlerwp_embed_handler_audio
相關方法
wp_show_heic_upload_errorwp_kses_html_errorwp_send_json_errorwp_scheduled_deletewp_import_handle_uploadwp_check_php_version
引入
5.2.0
棄用
-

wp_should_handle_php_error: 這是一個 WordPress 內建的函式,它用於判斷是否應該處理 PHP 錯誤。如果將這個函式的返回值設定為 true,則 WordPress 將處理 PHP 錯誤;如果設定為 false,則 WordPress 不會處理 PHP 錯誤。

過濾一個給定的錯誤是否應該由致命錯誤處理程式來處理。

這個過濾器只有在錯誤還沒有被配置為由WordPress核心處理時才會被觸發。因此,它只允許新增更多的錯誤處理規則,但不能刪除現有的規則。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
return (bool) apply_filters( 'wp_should_handle_php_error', false, $error );
return (bool) apply_filters( 'wp_should_handle_php_error', false, $error );
return (bool) apply_filters( 'wp_should_handle_php_error', false, $error );

常見問題

FAQs
檢視更多 >