Trouble with wp_reset_postdata() in Admin Panel

Đã có trọn bộ đề thi thử THPT Quốc Gia 2022 các môn: vip.dethihsg247.com
QUẢNG CÁO: Đổi thẻ cào thành tiền mặt min rút 10k tại đây

I’m hooking into ‘edit_form_after_editor’

Check that I am dealing with a custom post type of ‘publications’

Create a number of arguments that I then run in a WP_Query

use that data to do stuff…
Then I want to reset $post back to how it was, so I run

But $post stays on the last item I had received from my new WP_Query().

What am I doing wrong? Is there a special way to reset the postdata when dealing with a custom post type?

Update:
At the beginning and end of the function I have:

At the beginning the title is the title for the custom post type I clicked on to edit, or blank if I am creating a new post.
At the end the title is always the last post from my query.

Xin chào các bạn và quý Thầy Cô. Hãy nhập từ khóa mình muốn vào ô tìm kiếm trên Website để tìm kiếm mọi thứ hoặc trên google các bạn hãy nhập từ khóa + dethihsg247.com để tìm kiếm các bài viết của chúng tôi nhé.
  • Hiện tại chúng tôi có hơn 25 nghìn bài văn mẫu các thể loại.
  • Kho tài liệu, đề thi học sinh giỏi các lớp vô cùng phong phú.
  • Mỗi ngày cập nhật hơn 100 đề thi chất lượng từ các website bán tài liệu lớn.

Tải đề thi VIP với giá siêu rẻ tại Vip.Dethihsg247.Com