OwlCyberSecurity - MANAGER
Edit File: class-ova-metabox.php
<?php /** * Include and setup custom metaboxes and fields. (make sure you copy this file to outside the CMB2 directory) * * Be sure to replace all instances of 'yourprefix_' with your project's prefix. * http://nacin.com/2010/05/11/in-wordpress-prefix-everything/ * * @category YourThemeOrPlugin * @package Demo_CMB2 * @license http://www.opensource.org/licenses/gpl-license.php GPL v2.0 (or later) * @link https://github.com/WebDevStudios/CMB2 */ add_action( 'cmb2_init', 'ova_sermon_metaboxes' ); function ova_sermon_metaboxes() { // Start with an underscore to hide fields from custom fields list $prefix = 'ova_sermon_met_'; /* Sermon Settings ***************************************************************************/ /* ************************************************************************************/ $sermon_settings = new_cmb2_box( array( 'id' => 'ovasermon_settings', 'title' => esc_html__( 'Sermon settings', 'ova-sermon' ), 'object_types' => array( 'sermon'), // Post type 'context' => 'normal', 'priority' => 'high', 'show_names' => true, ) ); $sermon_settings->add_field( array( 'name' => esc_html__( 'Date', 'ova-sermon' ), 'id' => $prefix . 'date', 'type' => 'text_date', 'date_format' => 'd.m.Y', ) ); $sermon_settings->add_field( array( 'name' => esc_html__( 'Choose a Video', 'ova-sermon' ), 'id' => $prefix . 'video', 'type' => 'file', 'options' => array( 'url' => false, ), 'text' => array( 'add_upload_file_text' => esc_html__( 'Add a Video', 'ova-sermon' ), ), ) ); $sermon_settings->add_field( array( 'name' => esc_html__( 'Choose a Audio', 'ova-sermon' ), 'id' => $prefix . 'audio', 'type' => 'file', 'options' => array( 'url' => false, ), 'text' => array( 'add_upload_file_text' => esc_html__( 'Add a Audio', 'ova-sermon' ), ), ) ); $sermon_settings->add_field( array( 'name' => esc_html__( 'Choose a Document', 'ova-sermon' ), 'id' => $prefix . 'document', 'type' => 'file', 'options' => array( 'url' => false, ), 'text' => array( 'add_upload_file_text' => esc_html__( 'Add a Document', 'ova-sermon' ), ), ) ); $sermon_settings->add_field( array( 'name' => esc_html__( 'Sort Order', 'ova-sermon' ), 'id' => $prefix . 'order_sermon', 'desc' => esc_html__( 'Insert Number', 'ova-sermon' ), 'type' => 'text', 'attributes' => array( 'type' => 'number', ), 'default' => 1, ) ); }