Answer the question
In order to leave comments, you need to log in
How to add meta fields in wordpress when saving a post?
I add code to functions.php
function sources_init($post_id) {
if(wp_is_post_revision($post_id)) return;
add_post_meta($post_id, '_sources', 'ТЕСТ');
}
add_action('save_post', 'sources_init');
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question