public function __construct($oProp) { parent::__construct($oProp); add_action("set_up_{$this->oProp->sClassName}", array($this, '_replyToRegisterPostType'), 999); if ($this->oProp->bIsAdmin) { add_action('load_' . $this->oProp->sPostType, array($this, '_replyToSetUpHooksForModel')); if ($this->oProp->sCallerPath) { new AdminPageFramework_PostType_Model__FlushRewriteRules($this); } } }
function __construct($oProp) { parent::__construct($oProp); add_action("set_up_{$this->oProp->sClassName}", array($this, '_replyToRegisterPostType'), 999); $this->oProp->aColumnHeaders = array('cb' => '<input type="checkbox" />', 'title' => $this->oMsg->get('title'), 'author' => $this->oMsg->get('author'), 'comments' => '<div class="comment-grey-bubble"></div>', 'date' => $this->oMsg->get('date')); if ($this->_isInThePage()) { add_filter("manage_{$this->oProp->sPostType}_posts_columns", array($this, '_replyToSetColumnHeader')); add_filter("manage_edit-{$this->oProp->sPostType}_sortable_columns", array($this, '_replyToSetSortableColumns')); add_action("manage_{$this->oProp->sPostType}_posts_custom_column", array($this, '_replyToPrintColumnCell'), 10, 2); add_action('admin_enqueue_scripts', array($this, '_replyToDisableAutoSave')); } }
/** * Sets up hooks and properties. * * @internal */ function __construct($oProp) { parent::__construct($oProp); // When instantiating this class from the plugin activation hook, 'init' is already done. if (did_action('init')) { $this->_replyToRegisterPostType(); } else { add_action('init', array($this, '_replyToRegisterPostType'), 999); // this is loaded in the front-end as well so should not be admin_init. Also "if ( is_admin() )" should not be used either. } // Properties $this->oProp->aColumnHeaders = array('cb' => '<input type="checkbox" />', 'title' => $this->oMsg->get('title'), 'author' => $this->oMsg->get('author'), 'comments' => '<div class="comment-grey-bubble"></div>', 'date' => $this->oMsg->get('date')); if ($this->_isInThePage()) { // For table columns add_filter("manage_{$this->oProp->sPostType}_posts_columns", array($this, '_replyToSetColumnHeader')); add_filter("manage_edit-{$this->oProp->sPostType}_sortable_columns", array($this, '_replyToSetSortableColumns')); add_action("manage_{$this->oProp->sPostType}_posts_custom_column", array($this, '_replyToSetColumnCell'), 10, 2); // Auto-save add_action('admin_enqueue_scripts', array($this, '_replyToDisableAutoSave')); } }