First of all, I’ve already checked the solution for this question:
Why doesn’t wp_update_post() update the post_status field?
I am having trouble with updating post_status of products and product_variations using wp_update_post(). This is the code:
First, I look for trashed products and product variations based on multiple conditions. If all conditions match, I run the update_product_status()
function with specified $post_id
.
The function runs, the log is being updated with correct post IDs, but the post_status just stays ‘trash’ and it is not updated at all.
What am I doing wrong? I’ve added the edit_date
, post_date
and post_date_gmt
arguments to wp_update_post, based on the answers from the other queston, but no luck.
- 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