wp_comment_trashnotice()
概述
wp_comment_trashnotice() 函数用于输出评论的“撤销移至回收站”文本,通常用于评论管理界面。
关键要点
- 函数输出评论的“撤销移至回收站”文本,用于提供用户操作反馈。
- 该函数在 WordPress 2.9.0 版本中引入,属于核心功能的一部分。
- 常用于 wp_dashboard_recent_comments() 和 post_comment_meta_box() 等函数中,以显示评论管理相关界面。
Outputs ‘undo move to Trash’ text for comments.
Source
function wp_comment_trashnotice() {
?>
<div class="hidden" id="trash-undo-holder">
<div class="trash-undo-inside">
</strong>' );
?>
<span class="undo untrash"><a href="#"></a></span>
</div>
</div>
<div class="hidden" id="spam-undo-holder">
<div class="spam-undo-inside">
</strong>' );
?>
<span class="undo unspam"><a href="#"></a></span>
</div>
</div>
</pre><p class="wporg-dot-link-list"><a href="https://developer.wordpress.org/reference/files/wp-admin/includes/template.php/">View all references</a> <a href="https://core.trac.wordpress.org/browser/tags/6.9.4/src/wp-admin/includes/template.php#L555">View on Trac</a> <a href="https://github.com/WordPress/wordpress-develop/blob/6.9.4/src/wp-admin/includes/template.php#L555-L576">View on GitHub</a></p></section>
<section class="wp-block-wporg-code-reference-related" data-nosnippet="true"><h2 id="related" class="is-toc-heading wp-block-heading has-heading-5-font-size" tabindex="-1" ><a href="#related">Related</a></h2> <section style="margin-top:var(--wp--preset--spacing--20)" class="wp-block-wporg-code-table" id="uses"><figure class="wp-block-table "><table><thead><tr><th scope="col">Uses</th><th scope="col">Description</th></tr></thead><tbody><tr class=""><td><a href="https://developer.wordpress.org/reference/functions/__/">__()</a><code>wp-includes/l10n.php
Retrieves the translation of $text.
_e()wp-includes/l10n.php
Displays translated text.
| Used by | Description |
|---|---|
wp_dashboard_recent_comments()wp-admin/includes/dashboard.php |
Show Comments section. |
post_comment_meta_box()wp-admin/includes/meta-boxes.php |
Displays comments for post. |
Changelog
| Version | Description |
|---|---|
| 2.9.0 | Introduced. |