本文整理匯總了PHP中Translate::text_domain方法的典型用法代碼示例。如果您正苦於以下問題:PHP Translate::text_domain方法的具體用法?PHP Translate::text_domain怎麽用?PHP Translate::text_domain使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Translate
的用法示例。
在下文中一共展示了Translate::text_domain方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: catch
*
* @wordpress-plugin
* Plugin Name: SilverWp
* Description: SilverWp is a framework to help developers create themes or plugins
* Version: 0.1
* Author: Michal Kalkowski
* Author URI: http://www.silversite.pl/
* License: GPL-2.0+
* License URI: http://www.gnu.org/licenses/gpl-2.0.txt
* Text Domain: silverwp
* Domain Path: /languages
*/
namespace SilverWp;
// Exit if accessed directly
if (!defined('ABSPATH')) {
die;
}
require_once 'vendor/autoload.php';
try {
SilverWp::getInstance()->isPlugin(new \SilverWp\Plugin());
$views = SILVERWP_LIBS_PATH . 'ssvafpress/views';
$assets_uri = plugin_dir_url(__FILE__) . 'assets';
FileSystem::getInstance()->addDirectory('assets_uri', $assets_uri);
FileSystem::getInstance()->addDirectory('views', $views);
Translate::$language_path = plugin_dir_path(__FILE__) . 'languages/';
Translate::$text_domain = 'silverwp';
Translate::init();
} catch (\SilverWp\Exception $ex) {
$ex->catchException();
}