Answer the question
In order to leave comments, you need to log in
How to check for empty lines and not write to the database?
There are metaboxes for writing to WordPress, how to check for empty lines and not write to the database if there is no data? I suppose through empty, but there is not enough knowledge.
Answer the question
In order to leave comments, you need to log in
// Обновляем данные в базе
if ( !empty( $my_data ) ) {
update_post_meta( $post_id, 'my_meta_key', $my_data );
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question