public function prepare()
 {
     if (!$this->requirements_met()) {
         return false;
     }
     // filter columns for specific post types
     add_filter('types_information_table_columns', array($this, 'filter_columns'), 10, 2);
     // twig
     $this->twig = new Types_Helper_Twig();
     // script / style
     add_action('admin_enqueue_scripts', array($this, 'on_admin_enqueue_scripts'));
     // special case: layouts active, but not compatible
     // the only case where we don't show the table
     if (defined('WPDDL_DEVELOPMENT') || defined('WPDDL_PRODUCTION')) {
         $compatible = new Types_Helper_Condition_Layouts_Compatible();
         if (!$compatible->valid()) {
             $data_files = array(TYPES_DATA . '/information/layouts-not-compatible.php');
             $this->show_data_as_container_in_meta_box($data_files);
             return;
         }
     }
     /* data files */
     $data_files = array(TYPES_DATA . '/information/table/template.php', TYPES_DATA . '/information/table/archive.php', TYPES_DATA . '/information/table/views.php', TYPES_DATA . '/information/table/forms.php');
     $this->show_data_as_table_in_meta_box($data_files);
 }
Example #2
0
 public function prepare()
 {
     if (!apply_filters('types_information_table', true)) {
         return false;
     }
     // no infos if any embedded plugin runs
     if ($this->embedded_plugin_running()) {
         return false;
     }
     // twig
     $this->twig = new Types_Helper_Twig();
     // script / style
     add_action('admin_enqueue_scripts', array($this, 'on_admin_enqueue_scripts'));
     // special case: layouts active, but not compatible
     // the only case where we don't show the table
     if (defined('WPDDL_DEVELOPMENT') || defined('WPDDL_PRODUCTION')) {
         $compatible = new Types_Helper_Condition_Layouts_Compatible();
         if (!$compatible->valid()) {
             $data_files = array(TYPES_DATA . '/information/layouts-not-compatible.php');
             $this->show_data_as_container_in_meta_box($data_files);
             return;
         }
     }
     /* data files */
     $data_files = array(TYPES_DATA . '/information/table/template.php', TYPES_DATA . '/information/table/archive.php', TYPES_DATA . '/information/table/views.php', TYPES_DATA . '/information/table/forms.php');
     $this->show_data_as_table_in_meta_box($data_files);
 }