Advertisement
SMSabuj

vc-blocks-load.php

Apr 2nd, 2017
45
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.17 KB | None | 0 0
  1. <?php
  2. if (!defined('ABSPATH')) die('-1');
  3. // Class started
  4. class stockVCExtendAddonClass {
  5.     function __construct() {
  6.         // We safely integrate with VC with this hook
  7.         add_action( 'init', array( $this, 'stockIntegrateWithVC' ) );
  8.     }
  9.  
  10.     public function stockIntegrateWithVC() {
  11.         // Checks if Visual composer is not installed
  12.         if ( ! defined( 'WPB_VC_VERSION' ) ) {
  13.             add_action('admin_notices', array( $this, 'stockShowVcVersionNotice' ));
  14.             return;
  15.         }
  16.  
  17.         // visual composer addons.
  18.         include STOCK_ACC_PATH . '/vc-addons/vc-slides.php';
  19.     }
  20.     // show visual composer version
  21.     public function stockShowVcVersionNotice() {
  22.         $theme_data = wp_get_theme();
  23.         echo '
  24.        <div class="notice notice-warning">
  25.          <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.', 'stock-crazycafe'), $theme_data->get('Name')).'</p>
  26.        </div>';
  27.     }
  28. }
  29. // Finally initialize code
  30. new stockVCExtendAddonClass();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement