generic_ping

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

WordPress Version: 6.1

/**
 * Sends pings to all of the ping site services.
 *
 * @since 1.2.0
 *
 * @param int $post_id Post ID.
 * @return int Same post ID as provided.
 */
function generic_ping($post_id = 0)
{
    $services = get_option('ping_sites');
    $services = explode("\n", $services);
    foreach ((array) $services as $service) {
        $service = trim($service);
        if ('' !== $service) {
            weblog_ping($service);
        }
    }
    return $post_id;
}

WordPress Version: 5.5

/**
 * Sends pings to all of the ping site services.
 *
 * @since 1.2.0
 *
 * @param int $post_id Post ID.
 * @return int Same as Post ID from parameter
 */
function generic_ping($post_id = 0)
{
    $services = get_option('ping_sites');
    $services = explode("\n", $services);
    foreach ((array) $services as $service) {
        $service = trim($service);
        if ('' !== $service) {
            weblog_ping($service);
        }
    }
    return $post_id;
}

WordPress Version: 4.0

/**
 * Sends pings to all of the ping site services.
 *
 * @since 1.2.0
 *
 * @param int $post_id Post ID.
 * @return int Same as Post ID from parameter
 */
function generic_ping($post_id = 0)
{
    $services = get_option('ping_sites');
    $services = explode("\n", $services);
    foreach ((array) $services as $service) {
        $service = trim($service);
        if ('' != $service) {
            weblog_ping($service);
        }
    }
    return $post_id;
}

WordPress Version: 3.7

/**
 * Sends pings to all of the ping site services.
 *
 * @since 1.2.0
 *
 * @param int $post_id Post ID. Not actually used.
 * @return int Same as Post ID from parameter
 */
function generic_ping($post_id = 0)
{
    $services = get_option('ping_sites');
    $services = explode("\n", $services);
    foreach ((array) $services as $service) {
        $service = trim($service);
        if ('' != $service) {
            weblog_ping($service);
        }
    }
    return $post_id;
}