wp_cron_conditionally_prevent_sslverify

函式
wp_cron_conditionally_prevent_sslverify ( $request )
Access
Private
引數
  • (array) $request The cron request arguments.
    Required:
返回值
  • (array) The filtered cron request arguments.
定義位置
相關方法
wp_print_community_events_markupwp_localize_community_eventswp_print_community_events_templateswp_ajax_get_community_eventswp_transition_comment_status
引入
5.7.0
棄用
-

wp_cron_conditionally_prevent_sslverify: 這是一個過濾鉤,允許你在使用WP Cron時有條件地阻止SSL驗證。SSL驗證是一個安全功能,可以驗證被訪問網站的SSL證書。如果你在執行WP Cron任務時遇到SSL驗證的問題,這個過濾鉤子就很有用。

如果’cron_request’引數包括一個HTTPS URL,則禁用SSL驗證。

這可以防止在HTTPS中斷時出現問題,即驗證HTTPS的嘗試會失敗。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
function wp_cron_conditionally_prevent_sslverify( $request ) {
if ( 'https' === wp_parse_url( $request['url'], PHP_URL_SCHEME ) ) {
$request['args']['sslverify'] = false;
}
return $request;
}
function wp_cron_conditionally_prevent_sslverify( $request ) { if ( 'https' === wp_parse_url( $request['url'], PHP_URL_SCHEME ) ) { $request['args']['sslverify'] = false; } return $request; }
function wp_cron_conditionally_prevent_sslverify( $request ) {
	if ( 'https' === wp_parse_url( $request['url'], PHP_URL_SCHEME ) ) {
		$request['args']['sslverify'] = false;
	}
	return $request;
}

常見問題

FAQs
檢視更多 >