/** * Read builder data ( Template parts, content ). * * @since 1.0.0 * @access public * @return array */ public function builder_read_data() { // Check ajax referer check_ajax_referer($this->action_nonce, $this->field_nonce); $type = isset($_POST['type']) ? $_POST['type'] : 'template'; $postid = (int) $_POST['template_id']; switch ($type) { case 'utility': $data = TF_Model::read_utility_data(); break; case 'module': global $tf_styling_control; $data = array('selectors_html_section' => $tf_styling_control->render_selector(wp_kses_stripslashes($_POST['module'])), 'styling_context' => '.tf_module_block_' . $_POST['shortcode_id'], 'uniqid' => $_POST['shortcode_id'], 'module' => $_POST['module'], 'mode' => 'module'); break; case 'row': global $tf_styling_control; $data = array('selectors_html_section' => $tf_styling_control->render_selector('row'), 'styling_context' => '.tf_row_block_' . $_POST['shortcode_id'], 'uniqid' => $_POST['shortcode_id'], 'module' => 'row', 'mode' => 'module'); break; case 'global': global $tf_styling_control; $data = array('selectors_html_section' => $tf_styling_control->render_selector('global'), 'styling_context' => '', 'uniqid' => 'global', 'module' => 'global', 'mode' => 'global'); break; default: $data = TF_Model::read_template_data($postid); break; } wp_send_json_success($data); }
</div> <!-- /themify_builder_module_panel --> </div> <div style="display: none;"> <?php wp_editor(' ', 'tf_hidden_editor'); ?> </div> <?php } // ! TF_Model::is_tf_styling_active ?> <div id="tf_main_loader" class="tf_interface"> <?php echo tf_loader_span(); ?> </div> <script type="text/javascript"> var _tdBootstrapTemplate = <?php echo json_encode(TF_Model::read_template_data($TF_Layout->layout_id)); ?> ; var _tdBootstrapUtility = <?php echo json_encode(TF_Model::read_utility_data()); ?> ; </script>