print_embed_comments_button()
- Since
- 4.4.0
- Source
wp-includes/embed.php:1116
Prints the necessary markup for the embed comments button.
Uses · 6
- is_404()Determines whether the query has resulted in a 404 (returns no results).
- get_comments_number()Retrieves the amount of comments a post has.
- comments_open()Determines whether the current post is open for comments.
- comments_link()Displays the link to the current post comments.
- _n()Translates and retrieves the singular or plural form based on the supplied number.
- number_format_i18n()Converts float number to format based on the locale.
Source
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}History
Introduced in 4.4.0. Unchanged from 6.7.7 through 7.1.0.
Signature, return type and hooks compared across 5 parsed releases.
About this page
- Parsed data
- Generated from the wordpress-develop 6.7.7 tag, from
src/wp-includes/embed.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it. - Corrections
- Something wrong on this page? Report it and it gets fixed in the next regeneration.