post_trackback_meta_box() - WordPress 函数参考中文文档

返回介绍

post_trackback_meta_box()

发布于 2017-09-11 字数2363 浏览 761 评论 0

post_trackback_meta_box( object $post )

Display trackback links form fields.


描述


参数

$post

(object)
(Required)


源代码

File: wp-admin/includes/meta-boxes.php

function post_trackback_meta_box($post) {
	$form_trackback = '<input type="text" name="trackback_url" id="trackback_url" class="code" value="' .
		esc_attr( str_replace( "\n", ' ', $post->to_ping ) ) . '" aria-describedby="trackback-url-desc" />';
	if ('' != $post->pinged) {
		$pings = '<p>'. __('Already pinged:') . '</p><ul>';
		$already_pinged = explode("\n", trim($post->pinged));
		foreach ($already_pinged as $pinged_url) {
			$pings .= "\n\t<li>" . esc_html($pinged_url) . "</li>";
		}
		$pings .= '</ul>';
	}

?>
<p>
	<label for="trackback_url"><?php _e( 'Send trackbacks to:' ); ?></label>
	<?php echo $form_trackback; ?>
</p>
<p id="trackback-url-desc" class="howto"><?php _e( 'Separate multiple URLs with spaces' ); ?></p>
<p><?php
	printf(
		/* translators: %s: Codex URL */
		__( 'Trackbacks are a way to notify legacy blog systems that you’ve linked to them. If you link other WordPress sites, they’ll be notified automatically using <a href="%s">pingbacks</a>, no other action necessary.' ),
		__( 'https://codex.wordpress.org/Introduction_to_Blogging#Managing_Comments' )
	);
?></p>
<?php
if ( ! empty($pings) )
	echo $pings;
}

更新日志

Version 描述
2.6.0 Introduced.

相关函数

Uses

  • wp-includes/l10n.php:
    __()
  • wp-includes/l10n.php:
    _e()
  • wp-includes/formatting.php:
    esc_attr()
  • wp-includes/formatting.php:
    esc_html()

User Contributed Notes

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

目前还没有任何评论,快来抢沙发吧!