AnsPress_Post_Table_Hooks::flag_view( array $views )

Description #

Add flagged post view.

Parameters #

  • $views
    array (Required) Views array.

Changelog #

VersionDescription
unknownunknown
4.1.5Introduced.

Source #

File: admin/class-list-table-hooks.php

	public static function flag_view( $views ) {
		global $post_type_object;
		$flagged_count = ap_total_posts_count( 'answer' === $post_type_object->name ? 'answer' : 'question', 'flag' );
		$class         = ap_sanitize_unslash( 'flagged', 'p' ) ? 'class="current" ' : '';

		$views['flagged'] = '<a ' . $class . 'href="edit.php?flagged=true&#038;post_type=' . $post_type_object->name . '">' . __( 'Flagged', 'anspress-question-answer' ) . ' <span class="count">(' . $flagged_count->total . ')</span></a>';

		return $views;
	}

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Add your comment