Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- * Initialize the meta boxes.
- */
- add_action( 'admin_init', 'idr_metaboxes' );
- /**
- * Meta Boxes demo code.
- *
- * You can find all the available option types
- * in demo-theme-options.php.
- *
- * @return void
- *
- * @access private
- * @since 2.0
- */
- function idr_metaboxes() {
- /**
- * Create a custom meta boxes array that we pass to
- * the OptionTree Meta Box API Class.
- */
- $sidebars = ot_get_option('create_sidebars');
- $sidebars_array = array();
- $sidebars_array[0] = array (
- 'label' => "Default Sidebar",
- 'value' => 'sidebar'
- );
- $sidebars_k = 1;
- if(!empty($sidebars)){
- foreach($sidebars as $sidebar){
- $sidebars_array[$sidebars_k++] = array(
- 'label' => $sidebar['title'],
- 'value' => $sidebar['sidebar_id']
- );
- }
- }
- /**
- * Register our meta boxes using the
- * ot_register_meta_box() function.
- */
- // these are all defined above, as arrays for Option Tree API, but omitted from pastebin
- ot_register_meta_box( $post_featured_metabox );
- ot_register_meta_box( $my_meta_box );
- ot_register_meta_box( $header_metabox );
- ot_register_meta_box( $slider_metabox );
- ot_register_meta_box( $client_metabox );
- ot_register_meta_box( $team_metabox );
- ot_register_meta_box( $pricing_metabox );
- ot_register_meta_box( $testimonial_metabox );
- ot_register_meta_box( $my_meta_box_pf );
- ot_register_meta_box( $portfolio_metabox2 );
- ot_register_meta_box( $page_metabox );
- ot_register_meta_box( $post_title_description );
- }
- /**
- * Use "Featured Image" box as a custom box
- */
- function custom_image_box() {
- remove_meta_box('postimagediv', 'testimonial', 'side');
- add_meta_box('postimagediv', __('Author Photo', 'idr_omnibiz'), 'post_thumbnail_meta_box', 'testimonial', 'normal', 'low');
- }
- add_action('do_meta_boxes', 'custom_image_box');
- // slider manager init
- function sbmanager_init() {
- wp_enqueue_script('jquery-ui-datepicker');
- wp_enqueue_style('jquery-style', get_template_directory_uri() . '/css/ui-lightness/jui-datepicker.css');
- wp_enqueue_script('jquery-custom-script', get_template_directory_uri() . '/inc/js/custom-script.js', false, '1.0', false);
- }
- add_action('admin_init', 'sbmanager_init');
Advertisement
Add Comment
Please, Sign In to add comment