On this page
print_embed_comments_button()
Prints the necessary markup for the embed comments button.
Source
File: wp-includes/embed.php. View all references
function print_embed_comments_button() {
if ( is_404() || ! ( get_comments_number() || comments_open() ) ) {
return;
}
?>
<div class="wp-embed-comments">
<a href="<?php comments_link(); ?>" target="_top">
<span class="dashicons dashicons-admin-comments"></span>
<?php
printf(
/* translators: %s: Number of comments. */
_n(
'%s <span class="screen-reader-text">Comment</span>',
'%s <span class="screen-reader-text">Comments</span>',
get_comments_number()
),
number_format_i18n( get_comments_number() )
);
?>
</a>
</div>
<?php
}
Related
Uses
| Uses | Description |
|---|---|
| _n() wp-includes/l10n.php | Translates and retrieves the singular or plural form based on the supplied number. |
| is_404() wp-includes/query.php | Determines whether the query has resulted in a 404 (returns no results). |
| comments_open() wp-includes/comment-template.php | Determines whether the current post is open for comments. |
| get_comments_number() wp-includes/comment-template.php | Retrieves the amount of comments a post has. |
| comments_link() wp-includes/comment-template.php | Displays the link to the current post comments. |
| number_format_i18n() wp-includes/functions.php | Converts float number to format based on the locale. |
Changelog
| Version | Description |
|---|---|
| 4.4.0 | Introduced. |
© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/print_embed_comments_button