Answer the question
In order to leave comments, you need to log in
How to enable metabox with Ajax?
I'm trying to load the necessary metabox(es) by event
add_action( 'wp_ajax_get_status_metabox','get_status_metabox' );
add_action( 'wp_ajax_nopriv_get_status_metabox','get_status_metabox' );
function get_status_metabox(){
/* 1: */ wp_send_json( add_meta_box('estate_object_control', 'Статус объекта', 'estate_object_control', 'estate', 'normal', 'high') );
/* 2: */ add_meta_box('estate_object_control', 'Статус объекта', 'estate_object_control', 'estate', 'normal', 'high')
}
success: function(response) {jQuery('#wpbody').append(response); console.log(response); }
Answer the question
In order to leave comments, you need to log in
Use ACF Pro and conditional fields, you will be happy. Judging by the rest of the questions, your knowledge of PHP / JS is not enough to implement these tasks through code. Nothing personal.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question