0

How to check if a specific post meta isset/!emtpy during updating or publishing a post ( save_post() )?

1 Answer 1

0

I don't know what you want to do besides checking the meta so i'm gonna give a very basic example.

function bt_check_saved_post_meta ($post_id) {
    if (!empty(get_post_meta($post_id, 'some_meta', true))) {
        // do something here
    }
}
add_action('save_post', 'bt_check_saved_post_meta');

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.