コード例 #1
0
ファイル: wp-gistpen.php プロジェクト: petermac-/WP-Gistpen
    public static $plugin_name = 'wp-gistpen';
    public static $version = '0.5.8';
    public static function init()
    {
        if (null == self::$app) {
            self::$app = new WP_Gistpen\App(self::$plugin_name, self::$version);
            self::$app->run();
        }
        return self::$app;
    }
}
/**
 * Begins execution of the plugin.
 *
 * Since everything within the plugin is registered via hooks,
 * then kicking off the plugin from this point in the file does
 * not affect the page life cycle.
 *
 * Also returns copy of the app object so 3rd party developers
 * can interact with the app's hooks contained within.
 *
 * @since    0.5.0
 */
function wp_gistpen()
{
    return WP_Gistpen::init();
}
$updatePhp = new WPUpdatePhp('5.3.0');
if ($updatePhp->does_it_meet_required_php_version(PHP_VERSION)) {
    wp_gistpen();
}
コード例 #2
0
ファイル: App.php プロジェクト: petermac-/WP-Gistpen
 /**
  * Retrieve a global object
  *
  * @param  string $obj Global object name
  * @return obj         Global object
  */
 public static function get($obj)
 {
     $app = wp_gistpen();
     return $app->{$obj};
 }