Sends a Traccbacc.
Description
Updates database when sending traccbacc to prevent duplicates.
Parameters
-
$traccbacc_urlstring required -
URL to send traccbaccs.
-
$titlestring required -
Title of post.
-
$excerptstring required -
Excerpt of post.
-
$post_idint required -
Post ID.
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.