michaeluno / admin-page-framework

Facilitates WordPress plugin and theme development.
http://admin-page-framework.michaeluno.jp/
Other
337 stars 71 forks source link

Create metaboxes for a specific page template #245

Closed szepeviktor closed 8 years ago

szepeviktor commented 8 years ago

The post type(s) or screen ID that the meta box is associated with.

Could I tie metaboxes to - let's say - the front page only?

michaeluno commented 8 years ago

Do you mean you want to display meta boxes in the front-end?

szepeviktor commented 8 years ago

NO!!! On the back-end. But only for a certain page template.

michaeluno commented 8 years ago

Do you mean this?

page_template

When the user selects an item in the Template select drop-down , do you want to display an associated meta box?

szepeviktor commented 8 years ago

When the user selects an item in the Template select drop-down , do you want to display an associated meta box?

Actually when the template is already set, thus after hitting Publish/Update.

michaeluno commented 8 years ago

You can set an empty array to the $this->oProp->aPostTypes property to disable the post meta box in the setUp() method.

    public function setUp() {

        ...

        if ( ...not the desired template... ) {
            $this->oProp->aPostTypes = array();
        }

        ...

    }
szepeviktor commented 8 years ago

Thank you!