/** * Preboot all types and setup the current type if any. */ public function admin_init() { // Preload all page types. foreach (papi_get_post_types() as $post_type) { papi_get_all_entry_types(['args' => $post_type]); } if (!$this->setup_papi()) { return; } // Setup entry type. $this->entry_type->setup(); }
/** * Setup page type. */ public function setup() { parent::setup(); // Remove post type support and meta boxes. $this->remove_post_type_support(); // Add support for displaying information in publish box from a page type. if (method_exists($this, 'publish_box')) { add_action('post_submitbox_misc_actions', [$this, 'publish_box']); } // Hide page template dropdown if it shouldn't be showed. if (!$this->show_page_template) { add_filter('theme_page_templates', '__return_empty_array'); } }