kalponikoronno

vc plugin

Mar 9th, 2018
150
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.06 KB | None | 0 0
  1. <?php
  2.  
  3. if(!defined('ABSPATH')) die('-1');
  4.  
  5.  //class started
  6. class themenameVCExtendAddonClass{
  7.  
  8.     function __construct(){
  9.         add_action('init', array($this, 'seoIntegrateWithVC'));
  10.     }
  11.  
  12.     public function seoIntegrateWithVC(){
  13.         if( ! defined('WPB_VC_VERSION')){
  14.             add_action('admin_notices', array($this, 'seoShowVcVersionNotice'));
  15.             return;
  16.         }
  17.  
  18.         // visual composer addons
  19.         include SEO_ACC_PATH . '/vc-addons/vc-slides.php';
  20.     }
  21.  
  22.     public function seoShowVcVersionNotice(){
  23.         $theme_data = wp_get_theme();
  24.         echo '
  25.            <div class="notice notice-warning">
  26.                <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.', 'mytheme'), $theme_data->get('Name')).'
  27.                </p>
  28.            </div>
  29.        ';
  30.     }
  31. }
  32.  
  33. // Finally initialize code
  34. new themenameVCExtendAddonClass();
Advertisement
Add Comment
Please, Sign In to add comment