-
Notifications
You must be signed in to change notification settings - Fork 4
/
admin.php
46 lines (40 loc) · 1.21 KB
/
admin.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
<?php
/**
* Include and setup custom metaboxes and fields.
*
* @category Genesis Minimum Images Extended
* @package Metaboxes
* @license http://www.opensource.org/licenses/gpl-license.php GPL v2.0 (or later)
* @link https://github.com/jaredatch/Custom-Metaboxes-and-Fields-for-WordPress
*/
//add_image_size( 'gmie-banner', 300, 200, true ); //(cropped)
add_filter( 'cmb_meta_boxes', 'gmie_metaboxes' );
/**
* Define the metabox and field configurations.
*
* @param array $meta_boxes
* @return array
*/
function gmie_metaboxes( array $meta_boxes ) {
// Start with an underscore to hide fields from custom fields list
$prefix = '_gmie_';
$meta_boxes[] = array(
'id' => 'gmie_metabox',
'title' => __( 'Banner Image', 'gmie' ),
'pages' => array( 'page', 'post' ), // Post type
'context' => 'side',
'priority' => 'default',
'show_names' => true, // Show field names on the left
'fields' => array(
array(
'name' => __( 'Image', 'gmie' ),
'desc' => __( 'Upload an image or enter a URL.', 'gmie' ),
'id' => $prefix . 'image',
'type' => 'file',
'save_id' => true,
),
),
);
// Add other metaboxes as needed
return $meta_boxes;
}