salmancreation

vc-blocks-load.php

Apr 27th, 2017
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.07 KB | None | 0 0
  1. <?php
  2.  
  3. if(!defined('ABSPATH')){
  4.     exit;
  5. }
  6.  
  7. //Class Startd
  8.  
  9. class unifyVCExtendaddonClass{
  10.    
  11.     function __construct(){
  12.         // We safely integrate with vc with this hook
  13.         add_action('init', array($this, 'unifyIntegratewithVC'));
  14.        
  15.     }
  16.    
  17.     public function unifyIntegratewithVC(){
  18.        
  19.         //Check if visual composer is not installed
  20.        
  21.         if(!defined('WPB_VC_VERSION')){
  22.            
  23.             add_action('admin_notices', array($this, 'unifyShowVcVersionNotice'));
  24.             return;
  25.         }
  26.        
  27.         //Visual Composer addons.
  28.        
  29.         include UNIFY_ACC_PATH.'/vc-addons/vc-slides.php';
  30.        
  31.     }
  32.    
  33.     //Show visual composer version
  34.    
  35.     public function unifyShowVcVersionNotice(){
  36.         $theme_data = wp_get_theme();
  37.         echo '
  38.        
  39.         <div class="notice notice-warning">
  40.             <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.', 'seo-textdomain'), $theme_data->get('Name')).'</p>
  41.         </div>';
  42.     }
  43.    
  44.    
  45. }
  46.  
  47.  
  48. new unifyVCExtendaddonClass();
  49.  
  50. ?>
Add Comment
Please, Sign In to add comment