1. 首页
  2. WordPress 函数手册

get_pung()

get_pung( int|WP_Post $post_id )

检索已ping的邮件的url。
Retrieve URLs already pinged for a post.

目录锚点:#参数#返回#源码#笔记


参数(Parameters)

参数 类型 必填 说明
$post_id (int | WP_Post) 必需 Post ID或对象。

返回(Return)

(bool|string[])已ping给定post的url数组,如果找不到post,则为false。


源码(Source)

/**
 * Retrieve URLs already pinged for a post.
 *
 * @since 1.5.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param int $post_id Post ID.
 * @return array
 */
function get_pung( $post_id ) {
	global $wpdb;
	$pung = $wpdb->get_var( $wpdb->prepare( "SELECT pinged FROM $wpdb->posts WHERE ID = %d", $post_id ));
	$pung = trim($pung);
	$pung = preg_split('/s/', $pung);

	/**
	 * Filter the list of already-pinged URLs for the given post.
	 *
	 * @since 2.0.0
	 *
	 * @param array $pung Array of URLs already pinged for the given post.
	 */
	return apply_filters( 'get_pung', $pung );
}
更新版本 源码位置 使用 被使用
4.7.0 wp-includes/post.php:4789 2 3

笔记(Notes)

例子

get_pung() 为WP2原创文章,链接:https://www.wp2.cn/functions/get_pung/