public static function get_instance() { if (!self::$instance) { self::$instance = new self(); } return self::$instance; }
public function set_editor_state() { if (!defined('DOING_AJAX') || !DOING_AJAX) { return; } check_admin_referer('MMTL_Editor', MMTL_NONCE_NAME); $post_id = !empty($_POST['post_id']) ? $_POST['post_id'] : 0; $activate = !empty($_POST['active']); MMTL_Editor::get_instance()->set_active_state($activate, $post_id); wp_send_json_success(); }