MailPoet\EmailEditor\Engine

Email_Editor::get_current_post()publicWC 1.0

Get the current post object

Method of the class: Email_Editor{}

No Hooks.

Return

Array|Mixed|WP_Post|null.

Usage

$Email_Editor = new Email_Editor();
$Email_Editor->get_current_post();

Email_Editor::get_current_post() code WC 9.8.1

public function get_current_post() {
	if ( isset( $_GET['post'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended
		$current_post = get_post( intval( $_GET['post'] ) ); // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- data valid
	} else {
		$current_post = $GLOBALS['post'];
	}
	return $current_post;
}