Answer the question
In order to leave comments, you need to log in
How to automatically assign additional field to all WordPress posts?
Good!
How to automatically assign additional a field to all WordPress posts that will contain its ID?
Thanks in advance!
Answer the question
In order to leave comments, you need to log in
If it’s clear on the question, then make a WP_Query request where you specify in the parameters, "post_status"=>"any"post_type here list everything you need (page, post, etc. custom, if any)
Then when you go through the received records in a loop :
$post_id = get_the_ID();
update_post_meta($post_id, 'custom_post_id', $post_id);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question