/** * Init the page template module. * * @return \Themosis\Configuration\Template */ public function make() { // Set an empty value for no templates. $templateNames = array_merge(['none' => __('- None -', THEMOSIS_FRAMEWORK_TEXTDOMAIN)], $this->names()); // Build a select field Metabox::make(__('Template'), 'page', ['context' => 'side', 'priority' => 'core', 'id' => 'themosisTemplate'])->set([Field::select('_themosisPageTemplate', [$templateNames], false, ['title' => __('Name', THEMOSIS_FRAMEWORK_TEXTDOMAIN)])]); return $this; }
<?php /* Plugin Name: Test Plugin */ require_once 'test-project/themosis.php'; add_action('init', function () { \Themosis\Facades\Metabox::make('Details', 'post')->set([Field::text('name'), Field::checkbox('channels', ['email', 'mail', 'morse'])]); });