Guest User

Untitled

a guest
May 16th, 2019
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.42 KB | None | 0 0
  1. <?php
  2. /*
  3. * Plugin Name: Icyclub
  4. * Plugin URI:
  5. * Description: Icyclub plugin is comptible for Themeansar theme.
  6. * Version: 1.4
  7. * Author: themeicy
  8. * Author URI: https://themeicy.com
  9. * License: GPL-2.0+
  10. * License URI: http://www.gnu.org/licenses/gpl-2.0.txt
  11. * Text Domain: icyclub
  12. * Domain Path: /languages
  13. */
  14.  
  15. define( 'ICYCP_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
  16. define( 'ICYCP_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
  17.  
  18. function icycp_activate() {
  19. $theme = wp_get_theme();
  20. if ( 'Consultup' == $theme->name){
  21. require_once('inc/consultup/features/customizer.php');
  22. require_once('inc/consultup/sections/homepage.php');
  23. }
  24.  
  25. elseif (( 'Shopbiz Lite' == $theme->name) || ('Spabeauty' == $theme->name) || ('Shopbiz Lite Child' == $theme->name)){
  26. require_once('inc/shopbiz/features/customizer.php');
  27. require_once('inc/shopbiz/sections/homepage.php');
  28. }
  29. }
  30. add_action( 'init', 'icycp_activate' );
  31.  
  32. function icycp_enqueue(){
  33. wp_enqueue_style('icycp-custom-controls-css', plugin_dir_url(__FILE__) . 'assets/css/customizer.css', false, '1.0.0');
  34. }
  35. add_action('admin_enqueue_scripts', 'icycp_enqueue');
  36.  
  37.  
  38. function icycp_customizer_section_live_preview() {
  39. wp_enqueue_script(
  40. 'icycp-section-customizer-preview', plugin_dir_url(__FILE__) . 'assets/js/customizer.js', array(
  41. 'jquery',
  42. 'customize-preview',
  43. ), 999, true
  44. );
  45. }
  46. add_action( 'customize_preview_init', 'icycp_customizer_section_live_preview' );
  47.  
  48.  
  49. $theme = wp_get_theme();
  50. if ( 'Consultup' == $theme->name){
  51.  
  52.  
  53. register_activation_hook( __FILE__, 'icycp_page_installation_function');
  54. function icycp_page_installation_function()
  55. {
  56. $item_details_page = get_option('item_details_page');
  57. if(!$item_details_page){
  58. require_once('inc/consultup/pages/home.php');
  59. require_once('inc/consultup/pages/blog.php');
  60. update_option( 'item_details_page', 'Done' );
  61. }
  62. }
  63. }
  64.  
  65. if (( 'Shopbiz Lite' == $theme->name) || ( 'Spabeauty' == $theme->name) || ('Shopbiz Lite Child' == $theme->name)){
  66. register_activation_hook( __FILE__, 'icycp_page_installation_function');
  67. function icycp_page_installation_function()
  68. {
  69. $item_details_page = get_option('item_details_page');
  70. if(!$item_details_page){
  71. require_once('inc/shopbiz/pages/home.php');
  72. require_once('inc/shopbiz/pages/blog.php');
  73. update_option( 'item_details_page', 'Done' );
  74. }
  75. }
  76. }
  77. ?>
Add Comment
Please, Sign In to add comment