get_to_ping

The timeline below displays how wordpress function get_to_ping has changed across different WordPress versions. If a version is not listed, refer to the next available version below.

WordPress Version: 6.1

/**
 * Retrieves URLs that need to be pinged.
 *
 * @since 1.5.0
 * @since 4.7.0 `$post` can be a WP_Post object.
 *
 * @param int|WP_Post $post Post ID or post object.
 * @return string[]|false List of URLs yet 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);
}

WordPress Version: 5.5

/**
 * Retrieve URLs that need to be pinged.
 *
 * @since 1.5.0
 * @since 4.7.0 `$post_id` can be a WP_Post object.
 *
 * @param int|WP_Post $post_id Post Object or ID
 * @return string[]|false List of URLs yet to ping.
 */
function get_to_ping($post_id)
{
    $post = get_post($post_id);
    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);
}

WordPress Version: 5.4

/**
 * Retrieve URLs that need to be pinged.
 *
 * @since 1.5.0
 * @since 4.7.0 `$post_id` can be a WP_Post object.
 *
 * @param int|WP_Post $post_id Post Object or ID
 * @param string[] List of URLs yet to ping.
 */
function get_to_ping($post_id)
{
    $post = get_post($post_id);
    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);
}

WordPress Version: 5.1

/**
 * Retrieve URLs that need to be pinged.
 *
 * @since 1.5.0
 * @since 4.7.0 `$post_id` can be a WP_Post object.
 *
 * @param int|WP_Post $post_id Post Object or ID
 * @return array
 */
function get_to_ping($post_id)
{
    $post = get_post($post_id);
    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 array $to_ping List of URLs yet to ping.
     */
    return apply_filters('get_to_ping', $to_ping);
}

WordPress Version: 4.7

/**
 * Retrieve URLs that need to be pinged.
 *
 * @since 1.5.0
 * @since 4.7.0 $post_id can be a WP_Post object.
 *
 * @param int|WP_Post $post_id Post Object or ID
 * @return array
 */
function get_to_ping($post_id)
{
    $post = get_post($post_id);
    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 array $to_ping List of URLs yet to ping.
     */
    return apply_filters('get_to_ping', $to_ping);
}

WordPress Version: 4.6

/**
 * Retrieve URLs that need to be pinged.
 *
 * @since 1.5.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param int $post_id Post ID
 * @return array
 */
function get_to_ping($post_id)
{
    global $wpdb;
    $to_ping = $wpdb->get_var($wpdb->prepare("SELECT to_ping FROM {$wpdb->posts} WHERE ID = %d", $post_id));
    $to_ping = sanitize_trackback_urls($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 array $to_ping List of URLs yet to ping.
     */
    return apply_filters('get_to_ping', $to_ping);
}

WordPress Version: 4.3

/**
 * Retrieve URLs that need to be pinged.
 *
 * @since 1.5.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param int $post_id Post ID
 * @return array
 */
function get_to_ping($post_id)
{
    global $wpdb;
    $to_ping = $wpdb->get_var($wpdb->prepare("SELECT to_ping FROM {$wpdb->posts} WHERE ID = %d", $post_id));
    $to_ping = sanitize_trackback_urls($to_ping);
    $to_ping = preg_split('/\s/', $to_ping, -1, PREG_SPLIT_NO_EMPTY);
    /**
     * Filter the list of URLs yet to ping for the given post.
     *
     * @since 2.0.0
     *
     * @param array $to_ping List of URLs yet to ping.
     */
    return apply_filters('get_to_ping', $to_ping);
}

WordPress Version: 4.0

/**
 * Retrieve URLs that need to be pinged.
 *
 * @since 1.5.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param int $post_id Post ID
 * @return array
 */
function get_to_ping($post_id)
{
    global $wpdb;
    $to_ping = $wpdb->get_var($wpdb->prepare("SELECT to_ping FROM {$wpdb->posts} WHERE ID = %d", $post_id));
    $to_ping = sanitize_trackback_urls($to_ping);
    $to_ping = preg_split('/\s/', $to_ping, -1, PREG_SPLIT_NO_EMPTY);
    /**
     * Filter the list of URLs yet to ping for the given post.
     *
     * @since 2.0.0
     *
     * @param array $to_ping List of URLs yet to ping.
     */
    $to_ping = apply_filters('get_to_ping', $to_ping);
    return $to_ping;
}

WordPress Version: 3.9

/**
 * Retrieve URLs that need to be pinged.
 *
 * @since 1.5.0
 * @uses $wpdb
 *
 * @param int $post_id Post ID
 * @return array
 */
function get_to_ping($post_id)
{
    global $wpdb;
    $to_ping = $wpdb->get_var($wpdb->prepare("SELECT to_ping FROM {$wpdb->posts} WHERE ID = %d", $post_id));
    $to_ping = sanitize_trackback_urls($to_ping);
    $to_ping = preg_split('/\s/', $to_ping, -1, PREG_SPLIT_NO_EMPTY);
    /**
     * Filter the list of URLs yet to ping for the given post.
     *
     * @since 2.0.0
     *
     * @param array $to_ping List of URLs yet to ping.
     */
    $to_ping = apply_filters('get_to_ping', $to_ping);
    return $to_ping;
}

WordPress Version: 3.7

/**
 * Retrieve URLs that need to be pinged.
 *
 * @since 1.5.0
 * @uses $wpdb
 *
 * @param int $post_id Post ID
 * @return array
 */
function get_to_ping($post_id)
{
    global $wpdb;
    $to_ping = $wpdb->get_var($wpdb->prepare("SELECT to_ping FROM {$wpdb->posts} WHERE ID = %d", $post_id));
    $to_ping = sanitize_trackback_urls($to_ping);
    $to_ping = preg_split('/\s/', $to_ping, -1, PREG_SPLIT_NO_EMPTY);
    $to_ping = apply_filters('get_to_ping', $to_ping);
    return $to_ping;
}