tex2005

option-tree bug 02

Mar 16th, 2018
162
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.24 KB | None | 0 0
  1. <?php
  2.  
  3. /**
  4.  * Initialize the meta boxes.
  5.  */
  6. add_action( 'admin_init', 'idr_metaboxes' );
  7.  
  8. /**
  9.  * Meta Boxes demo code.
  10.  *
  11.  * You can find all the available option types
  12.  * in demo-theme-options.php.
  13.  *
  14.  * @return    void
  15.  *
  16.  * @access    private
  17.  * @since     2.0
  18.  */
  19. function idr_metaboxes() {
  20.  
  21.     /**
  22.      * Create a custom meta boxes array that we pass to
  23.      * the OptionTree Meta Box API Class.
  24.      */
  25.  
  26.     $sidebars = ot_get_option('create_sidebars');
  27.     $sidebars_array = array();
  28.     $sidebars_array[0] = array (
  29.      'label' => "Default Sidebar",
  30.      'value' => 'sidebar'
  31.      );
  32.  
  33.     $sidebars_k = 1;
  34.     if(!empty($sidebars)){
  35.       foreach($sidebars as $sidebar){
  36.         $sidebars_array[$sidebars_k++] = array(
  37.           'label' => $sidebar['title'],
  38.           'value' => $sidebar['sidebar_id']
  39.           );
  40.       }
  41.     }
  42.  
  43.  
  44.     /**
  45.      * Register our meta boxes using the
  46.      * ot_register_meta_box() function.
  47.      */
  48.      // these are all defined above, as arrays for Option Tree API, but omitted from pastebin
  49.     ot_register_meta_box( $post_featured_metabox );
  50.     ot_register_meta_box( $my_meta_box );
  51.     ot_register_meta_box( $header_metabox );
  52.     ot_register_meta_box( $slider_metabox );
  53.     ot_register_meta_box( $client_metabox );
  54.     ot_register_meta_box( $team_metabox );
  55.     ot_register_meta_box( $pricing_metabox );
  56.     ot_register_meta_box( $testimonial_metabox );
  57.     ot_register_meta_box( $my_meta_box_pf );
  58.     ot_register_meta_box( $portfolio_metabox2 );
  59.     ot_register_meta_box( $page_metabox );
  60.     ot_register_meta_box( $post_title_description );
  61.  
  62. }
  63.  
  64.  
  65.  
  66. /**
  67.  * Use "Featured Image" box as a custom box
  68.  */
  69. function custom_image_box() {
  70.  
  71.     remove_meta_box('postimagediv', 'testimonial', 'side');
  72.  
  73.  
  74.     add_meta_box('postimagediv', __('Author Photo', 'idr_omnibiz'), 'post_thumbnail_meta_box', 'testimonial', 'normal', 'low');
  75.  
  76. }
  77. add_action('do_meta_boxes', 'custom_image_box');
  78.  
  79. // slider manager init
  80. function sbmanager_init() {
  81.  
  82.     wp_enqueue_script('jquery-ui-datepicker');
  83.     wp_enqueue_style('jquery-style', get_template_directory_uri() . '/css/ui-lightness/jui-datepicker.css');
  84.     wp_enqueue_script('jquery-custom-script', get_template_directory_uri() . '/inc/js/custom-script.js', false, '1.0', false);
  85.  
  86.     }
  87.  
  88.  
  89. add_action('admin_init', 'sbmanager_init');
Advertisement
Add Comment
Please, Sign In to add comment