W3cubDocs

/WordPress

do_all_pings()

Perform all pingbacks, enclosures, trackbacks, and send to pingback services.

Source

File: wp-includes/comment.php

function do_all_pings() {
	global $wpdb;

	// Do pingbacks.
	$pings = get_posts(
		array(
			'post_type'        => get_post_types(),
			'suppress_filters' => false,
			'nopaging'         => true,
			'meta_key'         => '_pingme',
			'fields'           => 'ids',
		)
	);

	foreach ( $pings as $ping ) {
		delete_post_meta( $ping, '_pingme' );
		pingback( null, $ping );
	}

	// Do enclosures.
	$enclosures = get_posts(
		array(
			'post_type'        => get_post_types(),
			'suppress_filters' => false,
			'nopaging'         => true,
			'meta_key'         => '_encloseme',
			'fields'           => 'ids',
		)
	);

	foreach ( $enclosures as $enclosure ) {
		delete_post_meta( $enclosure, '_encloseme' );
		do_enclose( null, $enclosure );
	}

	// Do trackbacks.
	$trackbacks = get_posts(
		array(
			'post_type'        => get_post_types(),
			'suppress_filters' => false,
			'nopaging'         => true,
			'meta_key'         => '_trackbackme',
			'fields'           => 'ids',
		)
	);

	foreach ( $trackbacks as $trackback ) {
		delete_post_meta( $trackback, '_trackbackme' );
		do_trackbacks( $trackback );
	}

	// Do Update Services/Generic Pings.
	generic_ping();
}

Changelog

Version Description
2.1.0 Introduced.

© 2003–2019 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/do_all_pings