Akismet::row_actions( array $actions, WP_Post $post )

Description #

Add post row action to mark a post as a spam.

Parameters #

  • $actions
    array (Required) List of actions.
  • $post
    WP_Post (Required) Post object.

Source #

File: addons/akismet/akismet.php

	public function row_actions( $actions, $post ) {
		if ( ! ap_is_cpt( $post ) || 'moderate' === $post->post_status ) {
			return $actions;
		}

		$nonce = wp_create_nonce( 'send_spam' );

		$actions['report_spam'] = '<a href="' . admin_url( 'admin.php?action=ap_mark_spam&post_id=' . $post->ID . '&nonce=' . $nonce ) . '" aria-label="' . __( 'Mark this post as a spam', 'anspress-question-answer' ) . '">' . __( 'Mark as spam', 'anspress-question-answer' ) . '</a>';


		return $actions;
	}

Leave a Reply

Your email address will not be published. Required fields are marked *

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

Add your comment