AnsPress_Post_Table_Hooks::comments_flag_query( object $screen )

Description #

Delay hooking our clauses filter to ensure it’s only applied when needed.

Parameters #

  • $screen
    object (Required) Current screen.

Source #

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

	public static function comments_flag_query( $screen ) {
		if ( 'edit-comments' !== $screen->id ) {
				return;
		}

		// Check if our Query Var is defined.
		if ( ap_sanitize_unslash( 'show_flagged', 'p' ) ) {
			add_action( 'comments_clauses', array( 'AnsPress_Admin', 'filter_comments_query' ) );
		}
	}

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