wp_should_replace_insecure_home_url

過濾鉤子
apply_filters( 'wp_should_replace_insecure_home_url', $should_replace_insecure_home_url )
引數
  • (bool) $should_replace_insecure_home_url Whether insecure HTTP URLs to the site should be replaced.
    Required:
定義位置
相關勾子
wp_should_handle_php_errorwp_prepare_themes_for_jswp_signature_url
相關方法
wp_should_replace_insecure_home_urlwp_replace_insecure_home_urlwp_replace_in_html_tags_wp_dashboard_recent_comments_rowwp_dashboard_recent_comments_controlwp_dashboard_recent_comments
引入
5.7.0
棄用
-

wp_should_replace_insecure_home_url: 這是一個 WordPress 內建的函式,它用於判斷是否應該替換不安全的主頁 URL。如果將這個函式的返回值設定為 true,則 WordPress 將替換不安全的主頁 URL;如果設定為 false,則 WordPress 不會替換不安全的主頁 URL。

過濾WordPress是否應該用HTTPS對應的網址來替換舊的HTTP網址。

如果一個WordPress網站的URL從HTTP改為HTTPS,預設情況下會返回 true。這個過濾器可以用來禁止這種行為,例如,在資料庫中手動替換URL之後。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
return apply_filters( 'wp_should_replace_insecure_home_url', $should_replace_insecure_home_url );
return apply_filters( 'wp_should_replace_insecure_home_url', $should_replace_insecure_home_url );
return apply_filters( 'wp_should_replace_insecure_home_url', $should_replace_insecure_home_url );

常見問題

FAQs
檢視更多 >