コード例 #1
0
ファイル: zopim.php プロジェクト: vanlong200880/uni
     * @param string $class name of class to autoload
     * @return TRUE to continue; otherwise FALSE
     */
    public function autoload($class)
    {
        // setup the class name
        $classname = str_replace('Zopim_', '', $class);
        $classname = strtolower(str_replace('_', '-', $classname));
        $classfile = ZOPIM_PLUGIN_DIR . 'includes/class-' . $classname . '.php';
        if (file_exists($classfile)) {
            require_once $classfile;
        }
    }
    /*
     * return reference to asset, relative to the base plugin's /assets/ directory
     * @param string $ref asset name to reference
     * @return string href to fully qualified location of referenced asset
     */
    public static function get_asset($ref)
    {
        $ret = plugin_dir_url(__FILE__) . 'assets/' . $ref;
        return $ret;
    }
    public function load_textdomain()
    {
        // Load plugin text domain
        load_plugin_textdomain('zopim-live-chat', FALSE, basename(dirname(__FILE__)) . '/languages');
    }
}
Zopim::get_instance();