BP_Activity_oEmbed_Extension::embed_comments_button()

Prints the markup for the activity embed comments button.


Description Description

Basically a copy of print_embed_comments_button(), but modified for the BP activity component.


Source Source

File: bp-activity/classes/class-bp-activity-oembed-extension.php

	public function embed_comments_button() {
		if ( ! did_action( 'bp_embed_content' ) || ! bp_is_single_activity() ) {
			return;
		}

		// Make sure our custom permalink shows up in the 'WordPress Embed' block.
		add_filter( 'the_permalink', array( $this, 'filter_embed_url' ) );

		// Only show comment bubble if we have some activity comments.
		$count = bp_activity_get_comment_count();
		if ( empty( $count ) ) {
			return;
		}
	?>

		<div class="wp-embed-comments">
			<a href="<?php bp_activity_thread_permalink(); ?>">
				<span class="dashicons dashicons-admin-comments"></span>
				<?php
				printf(
					_n(
						/* translators: accessibility text */
						'%s <span class="screen-reader-text">Comment</span>',
						/* translators: accessibility text */
						'%s <span class="screen-reader-text">Comments</span>',
						$count,
						'buddypress'
					),
					number_format_i18n( $count )
				);
				?>
			</a>
		</div>

	<?php
	}

Top ↑

Changelog Changelog

Changelog
Version Description
2.6.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.