コード例 #1
0
 /**
  * Cornerstone entry point.
  * @param  string $file This should be __FILE__ from the main plugin file
  * @return bool true if the instance was generated for the first time
  */
 public static function run($file)
 {
     if (isset(self::$instance)) {
         return false;
     }
     self::$file = $file;
     self::$path = plugin_dir_path($file);
     self::$url = plugin_dir_url($file);
     $data = get_file_data($file, array('Version', 'Text Domain', 'Domain Path'));
     self::$version = array_shift($data);
     self::$text_domain = array_shift($data);
     self::$domain_path = array_shift($data);
     self::$instance = new Cornerstone();
     self::$instance->setup();
     return true;
 }
コード例 #2
0
ファイル: helpers.php プロジェクト: saparhadi/morowaliweb
/**
 * Access Cornerstone without a global variable
 * @return object  main Cornerstone instance.
 */
function CS()
{
    return Cornerstone::instance();
}
コード例 #3
0
ファイル: cornerstone.php プロジェクト: saparhadi/morowaliweb
<?php

/*
Plugin Name: Cornerstone
Plugin URI: http://theme.co/cornerstone
Description: The WordPress Page Builder
Author: Themeco
Author URI: http://theme.co/
Version: 1.0.3
X Plugin: cornerstone
Text Domain: cornerstone
Domain Path: lang
*/
// Prevent direct access
if (!defined('ABSPATH')) {
    exit;
}
// Load main plugin class
require_once 'includes/class-cornerstone.php';
// Fire it up
Cornerstone::run(__FILE__);