generic_ping() WordPress Function

The generic_ping() function is used to send pings to other blogs and websites. Pings are used to notify other websites that your website has been updated.

generic_ping( int $post_id ) #

Sends pings to all of the ping site services.


Parameters

$post_id

(int)(Required)Post ID.


Top ↑

Return

(int) Same as Post ID from parameter


Top ↑

Source

File: wp-includes/comment.php

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;
}


Top ↑

Changelog

Changelog
VersionDescription
1.2.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.

Show More
Show More