Filter hook 'add_ping'

in WP Core File wp-includes/post.php at line 5877

View Source

add_ping

Filter Hook
Description
Filters the new ping URL to add for the given post.

Hook Information

File Location wp-includes/post.php View on GitHub
Hook Type Filter
Line Number 5877

Hook Parameters

Type Name Description
string $new New ping URL to add.

Usage Examples

Basic Usage
<?php
// Hook into add_ping
add_filter('add_ping', 'my_custom_filter', 10, 1);

function my_custom_filter($new) {
    // Your custom filtering logic here
    return $new;
}

Source Code Context

wp-includes/post.php:5877 - How this hook is used in WordPress core
<?php
5872  	 *
5873  	 * @since 2.0.0
5874  	 *
5875  	 * @param string $new New ping URL to add.
5876  	 */
5877  	$new = apply_filters( 'add_ping', $new );
5878  
5879  	$return = $wpdb->update( $wpdb->posts, array( 'pinged' => $new ), array( 'ID' => $post->ID ) );
5880  	clean_post_cache( $post->ID );
5881  	return $return;
5882  }

PHP Documentation

<?php
/**
	 * Filters the new ping URL to add for the given post.
	 *
	 * @since 2.0.0
	 *
	 * @param string $new New ping URL to add.
	 */
Quick Info
  • Hook Type: Filter
  • Parameters: 1
  • File: wp-includes/post.php
Related Hooks

Related hooks will be displayed here in future updates.