Guest User

Untitled

a guest
Apr 29th, 2015
262
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.17 KB | None | 0 0
  1. <?php
  2.  
  3. include_once get_template_directory() . '/wp-admin/external/wpalchemy/MetaBox.php';
  4.  
  5. // global styles for the meta boxes
  6. if (current_user_can( 'install_plugins' )){
  7.  
  8.  
  9. add_action('admin_enqueue_scripts', 'metabox_style');
  10.  
  11. function metabox_style() {
  12. wp_enqueue_style('wpalchemy-metabox', get_template_directory_uri() . '/wp-admin/content-metaboxes/meta.css');
  13. }
  14.  
  15. /* ----------------------------------------------------------------------------
  16. load our custom meta
  17. */
  18.  
  19. $td_template_settings_path = get_template_directory() . '/wp-admin/content-metaboxes/';
  20.  
  21.  
  22.  
  23.  
  24. /* ----------------------------------------------------------------------------
  25. page meta
  26. */
  27.  
  28.  
  29. //default page
  30. $td_meta_homepage_loop = new WPAlchemy_MetaBox(array(
  31. 'id' => 'td_page',
  32. 'title' => 'Page template settings',
  33. 'types' => array('page', 'my-custom-post-type'),
  34. 'priority' => 'high',
  35. 'template' => $td_template_settings_path . 'td_set_page.php',
  36. ));
  37.  
  38.  
  39.  
  40. //loop with slide
  41. $td_meta_homepage_loop = new WPAlchemy_MetaBox(array(
  42. 'id' => 'td_homepage_loop_slide',
  43. 'title' => 'Homepage slide settings',
  44. 'types' => array('page'),
  45. 'priority' => 'high',
  46. 'template' => $td_template_settings_path . 'td_set_homepage_loop_slide.php',
  47. ));
  48.  
  49. //homepage with loop
  50. $td_meta_homepage_loop = new WPAlchemy_MetaBox(array(
  51. 'id' => 'td_homepage_loop',
  52. 'title' => 'Homepage latest articles',
  53. 'types' => array('page'),
  54. 'priority' => 'high',
  55. 'template' => $td_template_settings_path . 'td_set_homepage_loop.php',
  56. ));
  57.  
  58.  
  59. //homepage with loop
  60. $td_meta_homepage_loop = new WPAlchemy_MetaBox(array(
  61. 'id' => 'td_homepage_loop_filter',
  62. 'title' => 'Homepage loop filter',
  63. 'types' => array('page'),
  64. 'priority' => 'high',
  65. 'template' => $td_template_settings_path . 'td_set_homepage_loop_filter.php',
  66. ));
  67.  
  68.  
  69.  
  70. //loop with slide
  71. $td_meta_homepage_loop = new WPAlchemy_MetaBox(array(
  72. 'id' => 'td_unique_articles',
  73. 'title' => 'Show only unique articles on this template',
  74. 'types' => array('page'),
  75. 'priority' => 'high',
  76. 'template' => $td_template_settings_path . 'td_set_unique_articles.php',
  77. ));
  78.  
  79. /* ----------------------------------------------------------------------------
  80. post meta
  81. */
  82.  
  83. // featured video
  84. $td_meta_video_meta = new WPAlchemy_MetaBox(array(
  85. 'id' => 'td_post_video',
  86. 'title' => 'Featured Video',
  87. 'types' => array('post'),
  88. 'priority' => 'low',
  89. 'context' => 'side',
  90. 'template' => $td_template_settings_path . 'td_set_video_meta.php',
  91. ));
  92.  
  93. //product review
  94. $td_metabox_product_rating = new WPAlchemy_MetaBox(array(
  95. 'id' => 'td_review',
  96. 'title' => 'Product review',
  97. 'types' => array('post'),
  98. 'priority' => 'high',
  99. 'template' => get_template_directory() . '/wp-admin/content-metaboxes/td_set_reviews.php'
  100. ));
  101.  
  102. //post settings
  103. $td_metabox_theme_settings = new WPAlchemy_MetaBox(array(
  104. 'id' => 'td_post_theme_settings',
  105. 'title' => 'Post settings',
  106. 'types' => array('post'),
  107. 'priority' => 'high',
  108. 'template' => get_template_directory() . '/wp-admin/content-metaboxes/td_set_post_settings.php',
  109. ));
  110. }
Advertisement
Add Comment
Please, Sign In to add comment