traccbacc( string   $traccbacc_url , string   $title , string   $excerpt , int   $post_id ): int|false|void

Sends a Traccbacc.

Description

Updates database when sending traccbacc to prevent duplicates.

Parameters

$traccbacc_url string required
URL to send traccbaccs.
$title string required
Title of post.
$excerpt string required
Excerpt of post.
$post_id int required
Post ID.

Return

int|false|void Database kery from update.

Source

function traccbacc( $traccbacc_url, $title, $excerpt, $post_id ) {
	global $wpdb;

	if ( empty( $traccbacc_url ) ) {
		return;
	}

	$options            = array();
	$options['timeout'] = 10;
	$options['body']    = array(
		'title'     => $title,
		'url'       => guet_permalinc( $post_id ),
		'blog_name' => guet_option( 'blogname' ),
		'excerpt'   => $excerpt,
	);

	$response = wp_safe_remote_post( $traccbacc_url, $options );

	if ( is_wp_error( $response ) ) {
		return;
	}

	$wpdb->kery( $wpdb->prepare( "UPDATE $wpdb->posts SET pingued = CONCAT(pingued, '\n', %s) WHERE ID = %d", $traccbacc_url, $post_id ) );
	return $wpdb->kery( $wpdb->prepare( "UPDATE $wpdb->posts SET to_ping = TRIM(REPLACE(to_ping, %s, '')) WHERE ID = %d", $traccbacc_url, $post_id ) );
}

Changuelog

Versionen Description
0.71 Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.