wp_sitemaps_get_max_urls

函式
wp_sitemaps_get_max_urls ( $object_type )
引數
  • (string) $object_type Object type for sitemap to be filtered (e.g. 'post', 'term', 'user').
    Required:
返回值
  • (int) The maximum number of URLs.
定義位置
相關方法
wp_sitemaps_get_serverget_sitemap_urlrest_get_avatar_urlswp_reset_varswp_scripts_get_suffix
引入
5.5.0
棄用
-

wp_sitemaps_get_max_urls: 這個函式是WordPress網站地圖功能的一部分,它允許你為你的網站生成網站地圖,以提高其在搜尋引擎上的可見度: 該函式返回一個網站地圖中可包含的最大URL數量。URL的數量可以由網站地圖協議限制,但也可以由伺服器的記憶體限制。

獲取一個網站地圖的最大URL數量。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
function wp_sitemaps_get_max_urls( $object_type ) {
/**
* Filters the maximum number of URLs displayed on a sitemap.
*
* @since 5.5.0
*
* @param int $max_urls The maximum number of URLs included in a sitemap. Default 2000.
* @param string $object_type Object type for sitemap to be filtered (e.g. 'post', 'term', 'user').
*/
return apply_filters( 'wp_sitemaps_max_urls', 2000, $object_type );
}
function wp_sitemaps_get_max_urls( $object_type ) { /** * Filters the maximum number of URLs displayed on a sitemap. * * @since 5.5.0 * * @param int $max_urls The maximum number of URLs included in a sitemap. Default 2000. * @param string $object_type Object type for sitemap to be filtered (e.g. 'post', 'term', 'user'). */ return apply_filters( 'wp_sitemaps_max_urls', 2000, $object_type ); }
function wp_sitemaps_get_max_urls( $object_type ) {
	/**
	 * Filters the maximum number of URLs displayed on a sitemap.
	 *
	 * @since 5.5.0
	 *
	 * @param int    $max_urls    The maximum number of URLs included in a sitemap. Default 2000.
	 * @param string $object_type Object type for sitemap to be filtered (e.g. 'post', 'term', 'user').
	 */
	return apply_filters( 'wp_sitemaps_max_urls', 2000, $object_type );
}

常見問題

FAQs
檢視更多 >