src/FlexPress/Components/MetaBox/Helper.php
public function addMetaBoxes()
    {

        $this->metaBoxes->rewind();
        while ($this->metaBoxes->valid()) {

            $metaBox = $this->metaBoxes->current();

            foreach ($metaBox->getSupportedPostTypes() as $postType) {

                add_meta_box(
                    $metaBox->getID(),
                    $metaBox->getTitle(),
                    array(
                        $metaBox,
                        'getCallback'
                    ),
                    $postType,
                    $metaBox->getContext(),
                    $metaBox->getPriority(),
                    $metaBox->getCallbackArgs()
                );

                add_action('save_post', array($metaBox, 'savePostCallback'));

            }

            $this->metaBoxes->next();

        }

    }
public function addMetaBoxes()
    {

        $this->metaBoxes->rewind();
        while ($this->metaBoxes->valid()) {

            $metaBox = $this->metaBoxes->current();

            foreach ($metaBox->getSupportedPostTypes() as $postType) {

                add_meta_box(
                    $metaBox->getID(),
                    $metaBox->getTitle(),
                    array(
                        $metaBox,
                        'getCallback'
                    ),
                    $postType,
                    $metaBox->getContext(),
                    $metaBox->getPriority(),
                    $metaBox->getCallbackArgs()
                );

                add_action('save_post', array($metaBox, 'savePostCallback'));

            }

            $this->metaBoxes->next();

        }

    }
public function addMetaBoxes ( ) { $ this -> metaBoxes -> rewind ( ) ; while ( $ this -> metaBoxes -> valid ( ) ) { $ metaBox = $ this -> metaBoxes -> current ( ) ; foreach ( $ metaBox -> getSupportedPostTypes ( ) as $ postType ) { add_meta_box ( $ metaBox -> getID ( ) , $ metaBox -> getTitle ( ) , array ( $ metaBox , 'getCallback' ) , $ postType , $ metaBox -> getContext ( ) , $ metaBox -> getPriority ( ) , $ metaBox -> getCallbackArgs ( ) ) ; add_action ( 'save_post' , array ( $ metaBox , 'savePostCallback' ) ) ; } $ this -> metaBoxes -> next ( ) ; } }
Registers all the meta boxes added
@author Tim Perry
Registers all the meta boxes added