public function render() { foreach (array($this->_shortcode_options) as $control) { $control_manager = new syn_control_manager(); $html = '<div id="' . $control['id'] . '" class="shortcode-content">'; $fields = $control['fields']; foreach ($fields as $field) { $html .= $control_manager->render($field); } $html .= '</div>'; } return $html; }
/** * Show the metabox on the post type page. * @global type $post */ public function show_metabox() { //get the post for this page global $post; $control_manager = new syn_control_manager(); //use nonce for verification echo '<input type="hidden" name="wp_meta_box_nonce" value="', wp_create_nonce(basename(__FILE__)), '" />'; //if (!empty($this->_meta_box['promotion'])) { //$promotion = $this->_meta_box['promotion']; //$this->_fields_generator->add_promotion_box($promotion); //} echo '<table class="form-table syn_metabox">'; //loop the fields foreach ($this->_meta_box['fields'] as $field) { //get the post fields $meta = get_post_meta($post->ID, $field['name'], 'multicheck' != $field['type']); echo '<tr class="synth-type-' . sanitize_html_class($field['type']) . ' cmb_id_' . sanitize_html_class($field['id']) . '">'; echo '<td>'; echo $control_manager->render($field, $meta); echo '</td>'; echo '</tr>'; } echo '</table>'; }