Advertisement
webrur

Class 10

Apr 25th, 2017
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.35 KB | None | 0 0
  1. <?php
  2.  
  3. if (!defined('ABSPATH')) die('-1');
  4.  
  5. // Class started
  6. class factorianVCExtendAddonClass {
  7.  
  8. function __construct() {
  9. // We safely integrate with VC with this hook
  10. add_action( 'init', array( $this, 'factorianIntegrateWithVC' ) );
  11. }
  12.  
  13. public function factorianIntegrateWithVC() {
  14. // Checks if Visual composer is not installed
  15. if ( ! defined( 'WPB_VC_VERSION' ) ) {
  16. add_action('admin_notices', array( $this, 'factorianShowVcVersionNotice' ));
  17. return;
  18. }
  19.  
  20.  
  21. // visual composer addons.
  22. include FACTORIAN_ACC_PATH . '/vc-addons/vc-slides.php';
  23. include FACTORIAN_ACC_PATH . '/vc-addons/vc-logo-carousel.php';
  24. include FACTORIAN_ACC_PATH . '/vc-addons/vc-service-box.php';
  25.  
  26. }
  27.  
  28. // show visual composer version
  29. public function factorianShowVcVersionNotice() {
  30. $theme_data = wp_get_theme();
  31. echo '
  32. <div class="notice notice-warning">
  33. <p>'.sprintf(__('<strong>%s</strong> recommends <strong><a href="'.site_url().'/wp-admin/themes.php?page=tgmpa-install-plugins" target="_blank">Visual Composer</a></strong> plugin to be installed and activated on your site.', 'factorian-crazycafe'), $theme_data->get('Name')).'</p>
  34. </div>';
  35. }
  36. }
  37. // Finally initialize code
  38. new factorianVCExtendAddonClass();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement