mirror of
https://ghproxy.net/https://github.com/AlxMedia/curver.git
synced 2025-08-28 00:58:03 +08:00
Initial commit
This commit is contained in:
commit
ee50200fe7
353 changed files with 78977 additions and 0 deletions
85
functions/meta-boxes.php
Normal file
85
functions/meta-boxes.php
Normal file
|
@ -0,0 +1,85 @@
|
|||
<?php
|
||||
function curver_get_meta_box( $meta_boxes ) {
|
||||
|
||||
/* do not show */
|
||||
$prefix = '_';
|
||||
|
||||
/* get sidebars */
|
||||
$sidebars = array();
|
||||
if ( isset( $GLOBALS['wp_registered_sidebars'] ) ) {
|
||||
$sidebars = $GLOBALS['wp_registered_sidebars'];
|
||||
}
|
||||
$sidebars_choices = array();
|
||||
foreach ( $sidebars as $sidebar ) {
|
||||
$sidebars_choices[ $sidebar['id'] ] = $sidebar['name'];
|
||||
}
|
||||
|
||||
/* Page options
|
||||
/* ------------------------------------ */
|
||||
$meta_boxes[] = array(
|
||||
'id' => 'page-options',
|
||||
'title' => esc_html__( 'Page Options', 'curver' ),
|
||||
'post_types' => array( 'page' ),
|
||||
'context' => 'advanced',
|
||||
'priority' => 'high',
|
||||
'autosave' => false,
|
||||
'fields' => array(
|
||||
array(
|
||||
'id' => $prefix . 'sidebar_primary',
|
||||
'name' => esc_html__( 'Primary Sidebar', 'curver' ),
|
||||
'type' => 'select',
|
||||
'placeholder' => esc_html__( 'Select a sidebar', 'curver' ),
|
||||
'options' => $sidebars_choices,
|
||||
),
|
||||
array(
|
||||
'id' => $prefix . 'layout',
|
||||
'type' => 'image_select',
|
||||
'name' => esc_html__( 'Layout', 'curver' ),
|
||||
'std' => 'inherit',
|
||||
'force_delete' => false,
|
||||
'max_file_uploads' => '4',
|
||||
'options' => array(
|
||||
'inherit' => get_template_directory_uri() . '/functions/images/layout-off.png',
|
||||
'col-1c' => get_template_directory_uri() . '/functions/images/col-1c.png',
|
||||
'col-2cl' => get_template_directory_uri() . '/functions/images/col-2cl.png',
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
/* Post options
|
||||
/* ------------------------------------ */
|
||||
$meta_boxes[] = array(
|
||||
'id' => 'post-options',
|
||||
'title' => esc_html__( 'Post Options', 'curver' ),
|
||||
'post_types' => array( 'post' ),
|
||||
'context' => 'advanced',
|
||||
'priority' => 'high',
|
||||
'autosave' => false,
|
||||
'fields' => array(
|
||||
array(
|
||||
'id' => $prefix . 'sidebar_primary',
|
||||
'name' => esc_html__( 'Primary Sidebar', 'curver' ),
|
||||
'type' => 'select',
|
||||
'placeholder' => esc_html__( 'Select a sidebar', 'curver' ),
|
||||
'options' => $sidebars_choices,
|
||||
),
|
||||
array(
|
||||
'id' => $prefix . 'layout',
|
||||
'type' => 'image_select',
|
||||
'name' => esc_html__( 'Layout', 'curver' ),
|
||||
'std' => 'inherit',
|
||||
'force_delete' => false,
|
||||
'max_file_uploads' => '4',
|
||||
'options' => array(
|
||||
'inherit' => get_template_directory_uri() . '/functions/images/layout-off.png',
|
||||
'col-1c' => get_template_directory_uri() . '/functions/images/col-1c.png',
|
||||
'col-2cl' => get_template_directory_uri() . '/functions/images/col-2cl.png',
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
return $meta_boxes;
|
||||
}
|
||||
add_filter( 'rwmb_meta_boxes', 'curver_get_meta_box' );
|
Loading…
Add table
Add a link
Reference in a new issue