_close_comments_for_old_posts

Advertisement

Private Access Private Access

This function’s access is marked private. This means it is not intended for use by plugin or theme developers, only in other core functions. It is listed here for completeness.

Summery Summery

Close comments on old posts on the fly, without any extra DB queries. Hooked to the_posts.

Syntax Syntax

_close_comments_for_old_posts( WP_Post $posts, WP_Query $query )

Parameters Parameters

$posts

(Required) Post data object.

$query

(Required) Query object.

Return Return

(array)

Source Source

File: wp-includes/comment.php

 *
 * @param string $server Host of blog to connect to.
 * @param string $path Path to send the ping.
 */
function weblog_ping( $server = '', $path = '' ) {
	include_once ABSPATH . WPINC . '/class-IXR.php';
	include_once ABSPATH . WPINC . '/class-wp-http-ixr-client.php';

	// Using a timeout of 3 seconds should be enough to cover slow servers.
	$client             = new WP_HTTP_IXR_Client( $server, ( ( ! strlen( trim( $path ) ) || ( '/' === $path ) ) ? false : $path ) );
	$client->timeout    = 3;
	$client->useragent .= ' -- WordPress/' . get_bloginfo( 'version' );

	// When set to true, this outputs debug messages by itself.
	$client->debug = false;
	$home          = trailingslashit( home_url() );
	if ( ! $client->query( 'weblogUpdates.extendedPing', get_option( 'blogname' ), $home, get_bloginfo( 'rss2_url' ) ) ) { // Then try a normal ping.
		$client->query( 'weblogUpdates.ping', get_option( 'blogname' ), $home );
	}
}

/**
 * Default filter attached to pingback_ping_source_uri to validate the pingback's Source URI
 *
 * @since 3.5.1
 *
 * @see wp_http_validate_url()
 *
 * @param string $source_uri

Advertisement

Changelog Changelog

Changelog
Version Description
2.7.0 Introduced.

Advertisement

Leave a Reply