Attention Interested in functions, hooks, classes, or methods? Check out the new WordPress Code Reference!

Plugin API/Filter Reference/get to ping


The "get_to_ping" filter is used to filter the list of URLs that need to be pinged for a post, after they have been retrieved from the database and before they are returned from the get_to_ping() function.

Functions applied to this filter should not ping the URLs. Instead, they may modify the array of URLs to ping, and WordPress will ping them automatically.


When the 'get_to_ping' filter is called, it is passed a single argument containing an array of URLs that need to be pinged.

function filter_function_name( $to_ping ) {
  # ...
add_filter( 'get_to_ping', 'filter_function_name' );

Where 'filter_function_name' is the function WordPress should call when the $to_ping array is being retrieved. Note that the filter function must return an array of URLs after it is finished processing, or any code using the $to_ping array will break, and other plugins also filtering the $to_ping array may generate errors.

filter_function_name should be unique function name. It cannot match any other function name already declared.

See Also