public function postTypeMetaboxesDisplay()
    {
        // Check metaboxes
        if (empty($this->metaboxes)) {
            return;
        }

        // Defintions
        $slug = Request::getCurrentSlug();

        // Check slug
        if (empty($slug) || $slug !== $this->slug) {
            return;
        }

        // Get metaboxes
        foreach ($this->metaboxes as $metabox) {
            if (!$metabox) {
                continue;
            }

            // Get contents
            $id = (integer) $metabox->getModel()->getId();
            $title = (string) $metabox->getModel()->getTitle();
            $fields = (array) $metabox->getModel()->getFields();

            // Check fields
            if (empty($fields)) {
                continue;
            }

            // Title
            $title = empty($title) ? Translate::t('posttypehook.metabox') : $title;
            $id = empty($id) ? Helpers::urlize($title) : $id;

            // Update vars
            $identifier = $slug.'-meta-box-'.$id;

            // Add meta box
            $metabox->init($identifier, $slug);
        }
    }
public function postTypeMetaboxesDisplay()
    {
        // Check metaboxes
        if (empty($this->metaboxes)) {
            return;
        }

        // Defintions
        $slug = Request::getCurrentSlug();

        // Check slug
        if (empty($slug) || $slug !== $this->slug) {
            return;
        }

        // Get metaboxes
        foreach ($this->metaboxes as $metabox) {
            if (!$metabox) {
                continue;
            }

            // Get contents
            $id = (integer) $metabox->getModel()->getId();
            $title = (string) $metabox->getModel()->getTitle();
            $fields = (array) $metabox->getModel()->getFields();

            // Check fields
            if (empty($fields)) {
                continue;
            }

            // Title
            $title = empty($title) ? Translate::t('posttypehook.metabox') : $title;
            $id = empty($id) ? Helpers::urlize($title) : $id;

            // Update vars
            $identifier = $slug.'-meta-box-'.$id;

            // Add meta box
            $metabox->init($identifier, $slug);
        }
    }
public function postTypeMetaboxesDisplay ( ) { // Check metaboxes if ( empty ( $ this -> metaboxes ) ) { return ; } // Defintions $ slug = Request :: getCurrentSlug ( ) ; // Check slug if ( empty ( $ slug ) || $ slug !== $ this -> slug ) { return ; } // Get metaboxes foreach ( $ this -> metaboxes as $ metabox ) { if ( ! $ metabox ) { continue ; } // Get contents $ id = ( integer ) $ metabox -> getModel ( ) -> getId ( ) ; $ title = ( string ) $ metabox -> getModel ( ) -> getTitle ( ) ; $ fields = ( array ) $ metabox -> getModel ( ) -> getFields ( ) ; // Check fields if ( empty ( $ fields ) ) { continue ; } // Title $ title = empty ( $ title ) ? Translate :: t ( 'posttypehook.metabox' ) : $ title ; $ id = empty ( $ id ) ? Helpers :: urlize ( $ title ) : $ id ; // Update vars $ identifier = $ slug . '-meta-box-' . $ id ; // Add meta box $ metabox -> init ( $ identifier , $ slug ) ; } }
Hook building custom metaboxes for Post types.
Hook building custom metaboxes for Post types .