Papi_Page_Type::setup PHP Method

setup() public method

Setup page type.
public setup ( )
    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');
        }
    }

Usage Example

Esempio n. 1
0
 /**
  * Admin init.
  *
  * Setup the page type.
  */
 public function admin_init()
 {
     // Preload all page types.
     foreach (papi_get_post_types() as $post_type) {
         papi_get_all_content_types(['args' => $post_type]);
     }
     if (!$this->setup_papi()) {
         return;
     }
     $this->page_type->setup();
 }
All Usage Examples Of Papi_Page_Type::setup