WordPress как на ладони
Недорогой хостинг для сайтов на WordPress: wordpress.jino.ru
функция не описана

add_ping() WP 1.5.0

Add a URL to those already pinged.

  • Global. wpdb. $wpdb WordPress database abstraction object.
  • C версии 4.7.0 $post_id can be a WP_Post object.
  • C версии 4.7.0 $uri can be an array of URIs.
Хуки из функции
Возвращает

Число/false. How many rows were updated.

Использование

add_ping( $post_id, $uri );
$post_id(число/WP_Post) (обязательный)
Post object or ID.
$uri(строка/массив) (обязательный)
Ping URI or array of URIs.

Код add ping: wp-includes/post.php VER 5.1.1

<?php
function add_ping( $post_id, $uri ) {
	global $wpdb;

	$post = get_post( $post_id );
	if ( ! $post ) {
		return false;
	}

	$pung = trim( $post->pinged );
	$pung = preg_split( '/\s/', $pung );

	if ( is_array( $uri ) ) {
		$pung = array_merge( $pung, $uri );
	} else {
		$pung[] = $uri;
	}
	$new = implode( "\n", $pung );

	/**
	 * Filters the new ping URL to add for the given post.
	 *
	 * @since 2.0.0
	 *
	 * @param string $new New ping URL to add.
	 */
	$new = apply_filters( 'add_ping', $new );

	$return = $wpdb->update( $wpdb->posts, array( 'pinged' => $new ), array( 'ID' => $post->ID ) );
	clean_post_cache( $post->ID );
	return $return;
}