wp_get_update_php_annotation

函式
wp_get_update_php_annotation ( No parameters )
返回值
  • (string) Update PHP page annotation. An empty string if no custom URLs are provided.
定義位置
相關方法
wp_update_php_annotationwp_get_update_php_urlwp_get_update_datawp_get_update_https_url_get_path_to_translation
引入
5.2.0
棄用
-

wp_get_update_php_annotation: 這個函式檢索最新可用的PHP更新的註釋。它返回一個包含最新PHP更新註釋的字串,它提供了關於更新的資訊和任何重要的註釋。

返回虛擬主機改變”Update PHP”頁面URL的預設註釋。

如果虛擬主機改變了預設的”Update PHP”頁面URL,此函式將在{@see}之後使用,以返回一個一致的註釋。

function wp_get_update_php_annotation() {
	$update_url  = wp_get_update_php_url();
	$default_url = wp_get_default_update_php_url();

	if ( $update_url === $default_url ) {
		return '';
	}

	$annotation = sprintf(
		/* translators: %s: Default Update PHP page URL. */
		__( 'This resource is provided by your web host, and is specific to your site. For more information, <a href="%s" target="_blank">see the official WordPress documentation</a>.' ),
		esc_url( $default_url )
	);

	return $annotation;
}

常見問題

FAQs
檢視更多 >