trailingslashit

Definition:
function trailingslashit($string) {}

Appends a trailing slash.
Will remove trailing slash if it exists already before adding a trailing slash. This prevents double slashing a string or path.

Parameters

  • string $string: What to add the trailing slash to.

Return values

returns:String with trailing slash added.

Source code

function trailingslashit($string) {

	return untrailingslashit($string) . '/';

}

3079

trackback_url_list

Definition:
function trackback_url_list($tb_list, $post_id) {}

Do trackbacks for a list of URLs.

Parameters

  • string $tb_list: Comma separated list of URLs
  • int $post_id: Post ID

Source code

function trackback_url_list($tb_list, $post_id) {

	if ( ! empty( $tb_list ) ) {

		// get post data

		$postdata = wp_get_single_post($post_id, ARRAY_A);



		// import postdata as variables

		extract($postdata, EXTR_SKIP);



		// form an excerpt

		$excerpt = strip_tags($post_excerpt ? $post_excerpt : $post_content);



		if (strlen($excerpt) > 255) {

			$excerpt = substr($excerpt,0,252) . '...';

		}



		$trackback_urls = explode(',', $tb_list);

		foreach( (array) $trackback_urls as $tb_url) {

			$tb_url = trim($tb_url);

			trackback($tb_url, stripslashes($post_title), $excerpt, $post_id);

		}

	}

}

3077

trackback_url

Definition:
function trackback_url( $deprecated_echo = true ) {}

Displays the current post’s trackback URL.

Parameters

  • bool $deprecated_echo: Remove backwards compat in 2.5

Return values

returns:Should only be used to echo the trackback URL, use get_trackback_url() for the result instead.

Source code

function trackback_url( $deprecated_echo = true ) {

	if ( $deprecated_echo !== true )

		_deprecated_argument( __FUNCTION__, '2.5', __('Use <code>get_trackback_url()</code> instead if you do not want the value echoed.') );

	if ( $deprecated_echo )

		echo get_trackback_url();

	else

		return get_trackback_url();

}

3075

trackback_response

Definition:
function trackback_response($error = 0, $error_message = '') {}

trackback_response() – Respond with error or success XML message

Parameters

  • int|bool $error: Whether there was an error
  • string $error_message: Error message if an error occurred

Source code

function trackback_response($error = 0, $error_message = '') {

	header('Content-Type: text/xml; charset=' . get_option('blog_charset') );

	if ($error) {

		echo '<?xml version="1.0" encoding="utf-8"?'.">\n";

		echo "<response>\n";

		echo "<error>1</error>\n";

		echo "<message>$error_message</message>\n";

		echo "</response>";

		die();

	} else {

		echo '<?xml version="1.0" encoding="utf-8"?'.">\n";

		echo "<response>\n";

		echo "<error>0</error>\n";

		echo "</response>";

	}

}

3073

trackback_rdf

Definition:
function trackback_rdf( $deprecated = '' ) {}

Generates and displays the RDF for the trackback information of current post.
Deprecated in 3.0.0, and restored in 3.0.1.

Parameters

  • int $deprecated: Not used (Was $timezone = 0)

Source code

function trackback_rdf( $deprecated = '' ) {

	if ( !empty( $deprecated ) )

		_deprecated_argument( __FUNCTION__, '2.5' );



	if ( false !== stripos($_SERVER['HTTP_USER_AGENT'], 'W3C_Validator') )

		return;



	echo '<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"

			xmlns:dc="http://purl.org/dc/elements/1.1/"

			xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">

		<rdf:Description rdf:about="';

	the_permalink();

	echo '"'."\n";

	echo '    dc:identifier="';

	the_permalink();

	echo '"'."\n";

	echo '    dc:title="'.str_replace('--', '--', wptexturize(strip_tags(get_the_title()))).'"'."\n";

	echo '    trackback:ping="'.get_trackback_url().'"'." />\n";

	echo '</rdf:RDF>';

}

3071