• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer
WordPress a2z

WordPress a2z

WordPress Dynamic API Reference

  • Home
  • Plugins
  • Themes
  • Shortcodes
  • APIs
  • Classes
  • Files
  • Hooks
  • Sitemap
  • Blog
Home / Files / template-parts/post/discussion-meta.php


Lines:

1 to 34 of 34
<?php

/**
 * The template for displaying Current Discussion on posts
 *
 * @package WordPress
 * @subpackage Twenty_Nineteen
 * @since Twenty Nineteen 1.0
 */

/* Get data from current discussion on post. */
$discussion    = twentynineteen_get_discussion_data();
$has_responses = $discussion->responses > 0;

if ( $has_responses ) {
  /* translators: %d: Number of comments. */
  $meta_label = sprintf( _n( '%d Comment', '%d Comments', $discussion->responses, 'twentynineteen' ), $discussion->responses );
} else {
  $meta_label = __( 'No comments', 'twentynineteen' );
}
?>

<div class="discussion-meta">
	<?php
  if ( $has_responses ) {
    twentynineteen_discussion_avatars_list( $discussion->authors );
  }
  ?>
	<p class="discussion-meta-info">
		<?php echo twentynineteen_get_icon_svg( 'comment', 24 ); ?>
		<span><?php echo esc_html( $meta_label ); ?></span>
	</p>
</div><!-- .discussion-meta -->
 

 View on GitHub View on Trac

Called by

    Invoked by

      Calls

      1 to 3 of 3
      • twentynineteen_discussion_avatars_list() – Displays a list of avatars involved in a discussion for a given post.
      • twentynineteen_get_discussion_data() – Returns information about the current post’s discussion, with cache support.
      • twentynineteen_get_icon_svg() – Gets the SVG code for a given icon.

      Call hooks

      File name: template-parts/post/discussion-meta.php
      Plugin ref: Twenty Nineteen
      Version: 2.4
      Deprecated?: No
      API Letters: D,M,P,T

      Published: 25th November 2019 | Last updated: 8th April 2020

      Primary Sidebar

      Information

      File name: template-parts/post/discussion-meta.php
      Plugin ref: Twenty Nineteen
      Version: 2.4
      Deprecated?: No
      API Letters: D,M,P,T

      template-parts/post

      Footer

      WordPress a2z
      WordPress a2z
      WordPress Dynamic API Reference
      WordPress 6.1.1. PHP: 8.0.28
      WordPress a2z
      WordPress core a2z
      Genesis Theme Framework a2z
      Jetpack a2z
      WordPress develop tests
      Easy Digital Downloads a2z
      WooCommerce a2z
      Yoast SEO a2z
      WordPress Blocks

      Site:  wp-a2z.org
      © Copyright WordPress a2z 2014-2023. All rights reserved.


      Website designed and developed by Herb Miller
      Proudly powered by WordPress and oik plugins

      • Home
      • Blog
      • Sitemap
      • Sites