AdminPageFramework_PostType_View::__construct PHP Method

__construct() public method

public __construct ( $oProp )
    public function __construct($oProp)
    {
        parent::__construct($oProp);
        if ($this->oProp->bIsAdmin) {
            add_action('load_' . $this->oProp->sPostType, array($this, '_replyToSetUpHooksForView'));
            add_action('admin_menu', array($this, '_replyToRemoveAddNewSidebarMenu'));
        }
        add_action('the_content', array($this, '_replyToFilterPostTypeContent'));
    }

Usage Example

 /**
  * Sets up hooks and properties.
  * 
  * @internal
  */
 function __construct($oProp)
 {
     // 3.4.2+ Changed the hook to init from wp_loaded.
     if (did_action('init')) {
         // For the activation hook.
         $this->setup_pre();
     }
     add_action('init', array($this, 'setup_pre'));
     // Parent classes includes the model class and it registers the post type with the init hook.
     // For the case this class is instniated after the init hook, the setUp() method should be called earlier than that.
     // Thus, the parent constructor must be called after the call of setup_pre() above.
     parent::__construct($oProp);
 }
All Usage Examples Of AdminPageFramework_PostType_View::__construct