AnsPress_Post_Table_Hooks::add_question_flag_link( array $actions, object $post )

Description #

Add clear flag action button in question list.

Parameters #

  • $actions
    array (Required) Actions array.
  • $post
    object (Required) Post object.

Source #

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

	public static function add_question_flag_link( $actions, $post ) {
		if ( ap_get_post_field( 'flags', $post ) ) {
			$actions['flag'] = '<a href="#" data-query="ap_clear_flag::' . wp_create_nonce( 'clear_flag_' . $post->ID ) . '::' . $post->ID . '" class="ap-ajax-btn flag-clear" data-cb="afterFlagClear">' . __( 'Clear flag', 'anspress-question-answer' ) . '</a>';
		}

		return $actions;
	}

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