public function hooks()
    {
        // Register metabox
        // on admin init.
        $this->hook->action(
            'admin_init',
            [$this->metabox, 'register']
        )->dispatch();

        // Save all metabox meta
        // data on post save.
        $this->hook->action('save_post', function ($id) {
            $this->metabox->getModel()->setContext('post');

            $this->metabox->save($id);
        })->dispatch();

        // Save metabox meta data
        // on the comment save.
        $this->hook->action('edit_comment', function ($id) {
            $this->metabox->getModel()->setContext('comment');

            $this->metabox->save($id);
        })->dispatch();
    }
public function hooks()
    {
        // Register metabox
        // on admin init.
        $this->hook->action(
            'admin_init',
            [$this->metabox, 'register']
        )->dispatch();

        // Save all metabox meta
        // data on post save.
        $this->hook->action('save_post', function ($id) {
            $this->metabox->getModel()->setContext('post');

            $this->metabox->save($id);
        })->dispatch();

        // Save metabox meta data
        // on the comment save.
        $this->hook->action('edit_comment', function ($id) {
            $this->metabox->getModel()->setContext('comment');

            $this->metabox->save($id);
        })->dispatch();
    }
public function hooks ( ) { // Register metabox // on admin init. $ this -> hook -> action ( 'admin_init' , [ $ this -> metabox , 'register' ] ) -> dispatch ( ) ; // Save all metabox meta // data on post save. $ this -> hook -> action ( 'save_post' , function ( $ id ) { $ this -> metabox -> getModel ( ) -> setContext ( 'post' ) ; $ this -> metabox -> save ( $ id ) ; } ) -> dispatch ( ) ; // Save metabox meta data // on the comment save. $ this -> hook -> action ( 'edit_comment' , function ( $ id ) { $ this -> metabox -> getModel ( ) -> setContext ( 'comment' ) ; $ this -> metabox -> save ( $ id ) ; } ) -> dispatch ( ) ; }
Register metabox hooks.

@return void
Register metabox hooks .