get_to_ping

函式
get_to_ping ( $post )
引數
  • (int|WP_Post) $post Post ID or post object.
    Required:
返回值
  • (string[]|false) List of URLs yet to ping.
定義位置
相關方法
get_optionget_pungget_dropins_get_dropinsget_settings
引入
1.5.0
棄用
-

get_to_ping: 這個函式檢索當一個文章釋出時應該被ping的URL的列表。它返回一個從文章內容解析出來的URL陣列。

檢索需要被ping的URL。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
function get_to_ping( $post ) {
$post = get_post( $post );
if ( ! $post ) {
return false;
}
$to_ping = sanitize_trackback_urls( $post->to_ping );
$to_ping = preg_split( '/s/', $to_ping, -1, PREG_SPLIT_NO_EMPTY );
/**
* Filters the list of URLs yet to ping for the given post.
*
* @since 2.0.0
*
* @param string[] $to_ping List of URLs yet to ping.
*/
return apply_filters( 'get_to_ping', $to_ping );
}
function get_to_ping( $post ) { $post = get_post( $post ); if ( ! $post ) { return false; } $to_ping = sanitize_trackback_urls( $post->to_ping ); $to_ping = preg_split( '/s/', $to_ping, -1, PREG_SPLIT_NO_EMPTY ); /** * Filters the list of URLs yet to ping for the given post. * * @since 2.0.0 * * @param string[] $to_ping List of URLs yet to ping. */ return apply_filters( 'get_to_ping', $to_ping ); }
function get_to_ping( $post ) {
	$post = get_post( $post );

	if ( ! $post ) {
		return false;
	}

	$to_ping = sanitize_trackback_urls( $post->to_ping );
	$to_ping = preg_split( '/s/', $to_ping, -1, PREG_SPLIT_NO_EMPTY );

	/**
	 * Filters the list of URLs yet to ping for the given post.
	 *
	 * @since 2.0.0
	 *
	 * @param string[] $to_ping List of URLs yet to ping.
	 */
	return apply_filters( 'get_to_ping', $to_ping );
}

常見問題

FAQs
檢視更多 >