AnsPress_Theme::post_actions()

Description #

Ajax callback for post actions dropdown.

Changelog #

VersionDescription
3.0.0Introduced.

Source #

File: includes/class-theme.php

	public static function post_actions() {
		$post_id = (int) ap_sanitize_unslash( 'post_id', 'r' );

		if ( ! check_ajax_referer( 'post-actions-' . $post_id, 'nonce', false ) || ! is_user_logged_in() ) {
			ap_ajax_json( 'something_wrong' );
		}

		ap_ajax_json(
			array(
				'success' => true,
				'actions' => ap_post_actions( $post_id ),
			)
		);
	}

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