Exemplo n.º 1
0
 /**
  * Return an instance of this class
  */
 public static function get_instance()
 {
     if (self::$instance == null) {
         self::$instance = new self();
     }
     return self::$instance;
 }
 /**
  * Add to Visual Composer
  */
 public function integrateWithVC()
 {
     /* Get portfolio data */
     $portfolios = get_option(GW_Go_Portfolio::plugin_prefix() . '_portfolios');
     if (!empty($portfolios)) {
         foreach ($portfolios as $portfolio) {
             $dropdown_data[$portfolio['name']] = $portfolio['id'];
         }
     } else {
         $dropdown_data[0] = __('No portfolio(s) found!', 'go_portfolio_textdomain');
     }
     if (function_exists('vc_map')) {
         vc_map(array('name' => __('Go Portfolio', 'go_portfolio_textdomain'), 'description' => __('Responsive portfolios & galleries', 'go_portfolio_textdomain'), 'base' => 'go_portfolio', 'category' => __('Content', 'go_portfolio_textdomain'), 'class' => '', 'controls' => 'full', 'icon' => plugin_dir_url(__FILE__) . 'assets/go_portfolio_32x32.png', 'params' => array(array("type" => "dropdown", 'heading' => __('Portfolio name', 'go_portfolio_textdomain'), 'param_name' => 'id', 'value' => $dropdown_data, 'description' => __('Select portfolio', 'go_portfolio_textdomain'), 'admin_label' => true))));
     }
 }
Exemplo n.º 3
0
/**
 *
 * @package   Go – Responsive Portfolio for WP
 * @author    Granth <*****@*****.**>
 * @link      http://granthweb.com
 * @copyright 2015 Granth
 *
 * Plugin Name: Go – Responsive Portfolio for WP
 * Plugin URI:  http://codecanyon.net/user/Granth
 * Description: Portfolio manager plugin. This plugin allows you to manage, edit, and create new portfolios, showcases or teasers.
 * Version:     1.6.2
 * Author:      Granth
 * Author URI:  http://codecanyon.net/user/Granth
 * Text Domain: go_portfolio_textdomain
 * Domain Path: /lang
 */
/* Prevent direct call */
if (!defined('WPINC')) {
    die;
}
/* Load includes */
require_once plugin_dir_path(__FILE__) . 'class_go_portfolio.php';
require_once plugin_dir_path(__FILE__) . trailingslashit('includes/vc') . 'class_vc_extend.php';
/* Register hooks */
register_activation_hook(__FILE__, array('GW_Go_Portfolio', 'activate'));
register_deactivation_hook(__FILE__, array('GW_Go_Portfolio', 'deactivate'));
register_uninstall_hook(__FILE__, array('GW_Go_Portfolio', 'uninstall'));
/* Init */
GW_Go_Portfolio::get_instance();