BP_Activity_List_Table::get_views()

Get the list of views available on this table (e.g. “all”, “spam”).


Source Source

File: bp-activity/classes/class-bp-activity-list-table.php

	function get_views() {
		$url_base = add_query_arg( array( 'page' => 'bp-activity' ), bp_get_admin_url( 'admin.php' ) ); ?>

		<h2 class="screen-reader-text"><?php
			/* translators: accessibility text */
			esc_html_e( 'Filter activities list', 'buddypress' );
		?></h2>

		<ul class="subsubsub">
			<li class="all">
				<a href="<?php echo esc_url( $url_base ); ?>" class="<?php if ( 'all' === $this->view ) echo 'current'; ?>">
				<?php printf(
						/* translators: %s is the placeholder for the count html tag `<span class="count"/>` */
						esc_html__( 'All %s', 'buddypress' ),
						sprintf(
							'<span class="count">(%s)</span>',
							number_format_i18n( $this->all_count )
						)
					); ?>
				</a> |
			</li>
			<li class="spam">
				<a href="<?php echo esc_url( add_query_arg( array( 'activity_status' => 'spam' ), $url_base ) ); ?>" class="<?php if ( 'spam' === $this->view ) echo 'current'; ?>">
					<?php printf(
						/* translators: %s is the placeholder for the count html tag `<span class="count"/>` */
						esc_html__( 'Spam %s', 'buddypress' ),
						sprintf(
							'<span class="count">(%s)</span>',
							number_format_i18n( $this->spam_count )
						)
					); ?>
				</a>
			</li>

			<?php

			/**
			 * Fires inside listing of views so plugins can add their own.
			 *
			 * @since 1.6.0
			 *
			 * @param string $url_base Current URL base for view.
			 * @param string $view     Current view being displayed.
			 */
			do_action( 'bp_activity_list_table_get_views', $url_base, $this->view ); ?>
		</ul>
	<?php
	}


Top ↑

Changelog Changelog

Changelog
Version Description
1.6.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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