Filter hook 'pre_remote_source'

in WP Core File wp-includes/class-wp-xmlrpc-server.php at line 7054

View Source

pre_remote_source

Filter Hook
Description
Filters the pingback remote source.

Hook Information

File Location wp-includes/class-wp-xmlrpc-server.php View on GitHub
Hook Type Filter
Line Number 7054

Hook Parameters

Type Name Description
string $remote_source Response source for the page linked from.
string $pagelinkedto URL of the page linked to.

Usage Examples

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

function my_custom_filter($remote_source, $pagelinkedto) {
    // Your custom filtering logic here
    return $remote_source;
}

Source Code Context

wp-includes/class-wp-xmlrpc-server.php:7054 - How this hook is used in WordPress core
<?php
7049  		 * @since 2.5.0
7050  		 *
7051  		 * @param string $remote_source Response source for the page linked from.
7052  		 * @param string $pagelinkedto  URL of the page linked to.
7053  		 */
7054  		$remote_source = apply_filters( 'pre_remote_source', $remote_source, $pagelinkedto );
7055  
7056  		// Work around bug in strip_tags():
7057  		$remote_source = str_replace( '<!DOC', '<DOC', $remote_source );
7058  		$remote_source = preg_replace( '/[\r\n\t ]+/', ' ', $remote_source ); // normalize spaces
7059  		$remote_source = preg_replace( '/<\/*(h1|h2|h3|h4|h5|h6|p|th|td|li|dt|dd|pre|caption|input|textarea|button|body)[^>]*>/', "\n\n", $remote_source );

PHP Documentation

<?php
/**
		 * Filters the pingback remote source.
		 *
		 * @since 2.5.0
		 *
		 * @param string $remote_source Response source for the page linked from.
		 * @param string $pagelinkedto  URL of the page linked to.
		 */
Quick Info
  • Hook Type: Filter
  • Parameters: 2
  • File: wp-includes/class-wp-xmlrpc-server.php
Related Hooks

Related hooks will be displayed here in future updates.