/** * Add ShortCode builder button in editor * * @since 1.0.1 */ public function np_shortcode_builder_button() { ?> <div id="<?php echo $this->_uniqueID; ?> " class="np_sc_builder_content"> <div class="np-selector"> <h3>Select a ShortCode</h3> <hr> <select class="np-select"> <option value="">Select a shortcode</option> <?php foreach ($this->_builder['codes'] as $key => $val) { ?> <option value="<?php echo $key; ?> "><?php echo $val; ?> </option> <?php } ?> </select> <br><br> <div class="np_sc_cb"> <?php foreach ($this->_builder['atts'] as $key => $val) { ?> <table cellpadding="5" cellspacing="5" id="<?php echo $key; ?> " class="np_sc_builder_tbl"> <?php foreach ($this->_builder['atts'][$key] as $elem) { echo NP_FORM_HELPER::element('tr', $elem['name'], $elem['type'], $elem['term'], $elem['default'], $elem['default'], $elem['default'], isset($elem['options']) ? $elem['options'] : array()); } ?> </table> <?php } ?> </div> <input type="button" class="button button-primary insert_editor" value="Insert Into Editor"> </div> </div> <a data-src="<?php echo $this->_uniqueID; ?> " href="javascript:;" class="button np-shortcode-builder-button" title="<?php echo $this->_builder['label']; ?> "><span class="<?php echo $this->_builder['icon']; ?> "></span> <?php echo $this->_builder['label']; ?> </a> <?php }