public function add_modal_form()
{
$current_screen = get_current_screen();
if (!isset($current_screen->parent_base) || $current_screen->parent_base != 'edit') {
return;
}
// Determine if we should use CMB or generic form callback.
$callback = $this->form_callback();
$cmb_config = $this->get_cmb_config();
$is_callable = is_callable($callback);
$is_cmb = !empty($cmb_config);
$output_form = $is_callable || $is_cmb;
do_action("shortcode_button_before_modal_{$this->button_slug}", $this, $output_form);
if (!$output_form) {
return;
}
?>
<div class="scb-form-wrap" style="padding: 0 10px 20px;" id="<?php
echo esc_attr($this->button_slug);
?>
-form" title="<?php
echo esc_attr($this->button_data['button_tooltip']);
?>
">
<?php
if ($is_cmb) {
$this->do_cmb_form();
} else {
echo call_user_func($callback, $this->button_data, $this->args);
}
?>
</div>
<?php
}