/**
  * Add DataTables Extension settings
  */
 function register_metabox()
 {
     $m = array('id' => 'datatables_settings', 'title' => __('DataTables Settings', 'gv-datatables'), 'callback' => array($this, 'render_metabox'), 'callback_args' => array(), 'screen' => 'gravityview', 'file' => '', 'icon-class' => 'gv-icon-datatables', 'context' => 'side', 'priority' => 'default');
     if (class_exists('GravityView_Metabox_Tab')) {
         $metabox = new GravityView_Metabox_Tab($m['id'], $m['title'], $m['file'], $m['icon-class'], $m['callback'], $m['callback_args']);
         GravityView_Metabox_Tabs::add($metabox);
         unset($metabox);
     } else {
         add_meta_box('gravityview_' . $m['id'], $m['title'], $m['callback'], $m['screen'], $m['context'], $m['priority']);
     }
 }
 /**
  * Add default tabs to the Settings metabox
  * @since 1.8
  */
 private function add_settings_metabox_tabs()
 {
     $metaboxes = array(array('id' => 'template_settings', 'title' => __('View Settings', 'gravityview'), 'file' => 'view-settings.php', 'icon-class' => 'dashicons-admin-generic', 'callback' => '', 'callback_args' => ''), array('id' => 'single_entry', 'title' => __('Single Entry', 'gravityview'), 'file' => 'single-entry.php', 'icon-class' => 'dashicons-media-default', 'callback' => '', 'callback_args' => ''), array('id' => 'sort_filter', 'title' => __('Filter & Sort', 'gravityview'), 'file' => 'sort-filter.php', 'icon-class' => 'dashicons-sort', 'callback' => '', 'callback_args' => ''));
     /**
      * @filter `gravityview/metaboxes/default` Modify the default settings metabox tabs
      * @param array $metaboxes
      * @since 1.8
      */
     $metaboxes = apply_filters('gravityview/metaboxes/default', $metaboxes);
     foreach ($metaboxes as $m) {
         $tab = new GravityView_Metabox_Tab($m['id'], $m['title'], $m['file'], $m['icon-class'], $m['callback'], $m['callback_args']);
         GravityView_Metabox_Tabs::add($tab);
     }
     unset($tab);
 }
 /**
  * If Extension overrides tab_settings() and passes its own tab, add it to the tabbed settings metabox
  *
  * @since 1.8 (Extension version 1.0.7)
  *
  * @return void
  */
 function add_metabox_tab()
 {
     $tab_settings = $this->tab_settings();
     // Don't add a tab if it's empty.
     if (empty($tab_settings)) {
         return;
     }
     $tab_defaults = array('id' => '', 'title' => '', 'callback' => '', 'icon-class' => '', 'file' => '', 'callback_args' => '', 'context' => 'side', 'priority' => 'default');
     $tab = wp_parse_args($tab_settings, $tab_defaults);
     // Force the screen to be GravityView
     $tab['screen'] = 'gravityview';
     if (class_exists('GravityView_Metabox_Tab')) {
         $metabox = new GravityView_Metabox_Tab($tab['id'], $tab['title'], $tab['file'], $tab['icon-class'], $tab['callback'], $tab['callback_args']);
         GravityView_Metabox_Tabs::add($metabox);
     } else {
         add_meta_box('gravityview_' . $tab['id'], $tab['title'], $tab['callback'], $tab['screen'], $tab['context'], $tab['priority']);
     }
 }