/**
  * Get plugin version
  *
  * @return string
  */
 function wppb_version()
 {
     return wp_plugin_boilerplate()->version;
 }
示例#2
0
     * Language file loading
     *
     * @return void
     */
    public function load_language()
    {
        load_plugin_textdomain(WPPB_DOMAIN, false, dirname(plugin_basename(WPPB_MAIN_FILE)) . '/languages');
    }
    /**
     * System classes loader
     *
     * @param $class_name
     *
     * @return void
     */
    public function autoloader($class_name)
    {
        if (strpos($class_name, __NAMESPACE__) === false) {
            // skip non related classes
            return;
        }
        $class_path = WPPB_DIR . 'includes' . DIRECTORY_SEPARATOR . 'classes' . str_replace([__NAMESPACE__, '\\'], ['', DIRECTORY_SEPARATOR], $class_name) . '.php';
        if (file_exists($class_path)) {
            // load class file if found
            require_once $class_path;
        }
    }
}
// boot up the system
wp_plugin_boilerplate();