本文整理汇总了PHP中load_muplugin_textdomain函数的典型用法代码示例。如果您正苦于以下问题:PHP load_muplugin_textdomain函数的具体用法?PHP load_muplugin_textdomain怎么用?PHP load_muplugin_textdomain使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了load_muplugin_textdomain函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: load_our_textdomain
/**
* Load our plugin textdomain
*/
public static function load_our_textdomain()
{
$loaded = load_plugin_textdomain('wp-libre-form', false, dirname(plugin_basename(__FILE__)) . '/lang/');
if (!$loaded) {
$loaded = load_muplugin_textdomain('wp-libre-form', dirname(plugin_basename(__FILE__)) . '/lang/');
}
}
示例2: __construct
/**
* PHP5 Constructor
*
**/
function __construct()
{
// get number of field sets
$this->fields = isset($_GET['fields']) ? $_GET['fields'] : '';
// default to 15 field sets
if ($this->fields == '') {
$this->fields = 15;
}
// no more than 50 fields sets
if ($this->fields > 50) {
$this->fields = 50;
}
// activate or upgrade
if (isset($_GET['page']) && $_GET['page'] == 'add-new-users') {
$this->make_current();
}
// add admin menu page
add_action('admin_menu', array(&$this, 'plug_pages'));
// load text domain
if (defined('WPMU_PLUGIN_DIR') && file_exists(WPMU_PLUGIN_DIR . '/add-new-users.php')) {
load_muplugin_textdomain('add_new_users', 'add-new-users-files/languages');
} else {
load_plugin_textdomain('add_new_users', false, dirname(plugin_basename(__FILE__)) . '/add-new-users-files/languages');
}
}
示例3: load_textdomain
function load_textdomain()
{
if (preg_match('/mu\\-plugin/', PLUGINDIR) > 0) {
load_muplugin_textdomain('postindexer', false, dirname(dirname(plugin_basename(__FILE__))) . '/languages/');
} else {
load_plugin_textdomain('postindexer', false, dirname(dirname(plugin_basename(__FILE__))) . '/languages/');
}
}
示例4: loadTextdomain
public static function loadTextdomain()
{
// Load translations first from the languages directory
$locale = apply_filters('plugin_locale', get_locale(), $domain);
load_textdomain($domain, WP_LANG_DIR . '/my-plugin/' . self::$domain . '-' . $locale . '.mo');
// And then from this plugin folder
load_muplugin_textdomain('wpp', basename(dirname(__FILE__)) . '/languages');
}
示例5: register
static function register()
{
if (defined('EM_VERSION')) {
return;
}
load_muplugin_textdomain('redelivre', 'agenda/languages');
register_post_type('agenda', array('labels' => array('name' => _x('Evento', 'post type general name', 'redelivre'), 'singular_name' => _x('Evento', 'post type singular name', 'redelivre'), 'add_new' => _x('Adicionar novo', 'image', 'redelivre'), 'add_new_item' => __('Adicionar novo evento', 'redelivre'), 'edit_item' => __('Editar evento', 'redelivre'), 'new_item' => __('Novo evento', 'redelivre'), 'view_item' => __('Ver evento', 'redelivre'), 'search_items' => __('Buscar eventos', 'redelivre'), 'not_found' => __('Nenhum evento encontrado', 'redelivre'), 'not_found_in_trash' => __('Nenhum evento encontrado na lixeira', 'redelivre'), 'parent_item_colon' => ''), 'public' => true, 'rewrite' => true, 'capability_type' => 'post', 'hierarchical' => false, 'menu_position' => 10, 'has_archive' => true, 'supports' => array('title', 'editor', 'thumbnail')));
}
示例6: bootstrap
public function bootstrap()
{
if ($this->is_mu_plugin) {
load_muplugin_textdomain('wp-js-plugin');
} else {
load_plugin_textdomain('wp-js-plugin');
}
$core = WP_JS_Plugin_Core::instance();
add_action('init', array($core, 'maybe_bootstrap_admin'));
add_action('rest_api_init', array($core, 'bootstrap_api'), 10, 1);
}
示例7: plugin_textdomain
/**
* Loads the plugin text domain for translation
*/
public function plugin_textdomain()
{
$domain = 'acfsync';
$locale = apply_filters('plugin_locale', get_locale(), $domain);
load_textdomain($domain, WP_LANG_DIR . '/' . $domain . '/' . $domain . '-' . $locale . '.mo');
if (false !== strpos(__FILE__, basename(WPMU_PLUGIN_DIR))) {
load_muplugin_textdomain($domain, dirname(plugin_basename(__FILE__)) . '/lang/');
} else {
load_plugin_textdomain($domain, FALSE, dirname(plugin_basename(__FILE__)) . '/lang/');
}
}
示例8: incsub_support_init
function incsub_support_init()
{
global $wpdb, $ticket_status, $ticket_priority, $incsub_support_page, $incsub_support_page_long;
if (preg_match('/mu\\-plugin/', __FILE__) > 0) {
load_muplugin_textdomain(INCSUB_SUPPORT_LANG_DOMAIN, dirname(plugin_basename(__FILE__)) . '/languages');
} else {
load_plugin_textdomain(INCSUB_SUPPORT_LANG_DOMAIN, false, dirname(plugin_basename(__FILE__)) . '/languages');
}
if (is_admin()) {
wp_register_style('incsub_support_admin_css', plugins_url('incsub-support/css/wp_admin.css'), array(), INCSUB_SUPPORT_VERSION);
wp_register_script('incsub_support_admin_js', plugins_url('incsub-support/js/wp_admin.js'), array('jquery'), INCSUB_SUPPORT_VERSION, true);
}
$wpdb->tickets = incsub_support_tablename('tickets');
$wpdb->tickets_messages = incsub_support_tablename('tickets_messages');
$wpdb->tickets_cats = incsub_support_tablename('tickets_cats');
$wpdb->faq = incsub_support_tablename('faq');
$wpdb->faq_cats = incsub_support_tablename('faq_cats');
$ticket_priority = array(0 => __("Low", INCSUB_SUPPORT_LANG_DOMAIN), 1 => __("Normal", INCSUB_SUPPORT_LANG_DOMAIN), 2 => __("Elevated", INCSUB_SUPPORT_LANG_DOMAIN), 3 => __("High", INCSUB_SUPPORT_LANG_DOMAIN), 4 => __("Critical", INCSUB_SUPPORT_LANG_DOMAIN));
$ticket_status = array(0 => __("New", INCSUB_SUPPORT_LANG_DOMAIN), 1 => __("In progress", INCSUB_SUPPORT_LANG_DOMAIN), 2 => __("Waiting on User to reply", INCSUB_SUPPORT_LANG_DOMAIN), 3 => __("Waiting on Admin to reply", INCSUB_SUPPORT_LANG_DOMAIN), 4 => __("Stalled", INCSUB_SUPPORT_LANG_DOMAIN), 5 => __("Closed", INCSUB_SUPPORT_LANG_DOMAIN));
$incsub_support_imap = get_site_option('incsub_support_imap', array('host' => 'imap.gmail.com', 'port' => '993', 'ssl' => '/ssl', 'mailbox' => 'INBOX', 'username' => '', 'password' => ''));
if (isset($_POST['incsub_support_menu_name'])) {
update_site_option('incsub_support_menu_name', $_POST['incsub_support_menu_name']);
}
if (isset($_POST['incsub_support_from_name'])) {
update_site_option('incsub_support_from_name', $_POST['incsub_support_from_name']);
}
if (isset($_POST['incsub_support_from_mail'])) {
update_site_option('incsub_support_from_mail', $_POST['incsub_support_from_mail']);
}
if (isset($_POST['incsub_support_fetch_imap'])) {
update_site_option('incsub_support_fetch_imap', $_POST['incsub_support_fetch_imap']);
if (get_site_option('incsub_support_imap_frequency', '') != $_POST['incsub_support_imap_frequency']) {
if (wp_reschedule_event(0, $_POST['incsub_support_imap_frequency'], 'incsub_support_fetch_imap') === false) {
wp_schedule_event(0, $_POST['incsub_support_imap_frequency'], 'incsub_support_fetch_imap');
}
update_site_option('incsub_support_imap_frequency', $_POST['incsub_support_imap_frequency']);
}
if (empty($_POST['incsub_support_imap']['password'])) {
$_POST['incsub_support_imap']['password'] = $incsub_support_imap['password'];
}
update_site_option('incsub_support_imap', $_POST['incsub_support_imap']);
if (isset($_POST['test']) && $_POST['incsub_support_fetch_imap'] == "enabled") {
if (incsub_support_fetch_imap()) {
wp_redirect("{$incsub_support_settings_page}?page=support-options&updated=true&tested=true");
} else {
wp_redirect("{$incsub_support_settings_page}?page=support-options&updated=true&tested=false");
}
} else {
wp_redirect("{$incsub_support_settings_page}?page=support-options&updated=true");
}
}
}
示例9: loadTextDomain
public function loadTextDomain($domain = null, $path = null)
{
/** @var PluginInterface $this */
$domain = $domain !== null ? $domain : $this->getTextDomain();
$path = $path !== null ? $path : $this->getDomainPath();
$file = wp_normalize_path($this->getFile());
$muPluginDir = wp_normalize_path(WPMU_PLUGIN_DIR);
if (strpos($file, $muPluginDir) === 0) {
$path = basename($this->getDirectory()) . $path;
return load_muplugin_textdomain($domain, $path);
}
return load_plugin_textdomain($domain, false, $path);
}
示例10: __construct
/**
* PHP 5 constructor
**/
function __construct()
{
add_action('login_init', array($this, 'clean_redirect'));
add_filter('wp_logout', array(&$this, 'redirect'));
add_action('wpmu_options', array(&$this, 'network_option'));
add_action('update_wpmu_options', array(&$this, 'update_network_option'));
add_action('admin_init', array(&$this, 'add_settings_field'));
// load text domain
if (defined('WPMU_PLUGIN_DIR') && file_exists(WPMU_PLUGIN_DIR . '/logout-redirect.php')) {
load_muplugin_textdomain('logout_redirect', 'logout-redirect-files/languages');
} else {
load_plugin_textdomain('logout_redirect', false, dirname(plugin_basename(__FILE__)) . '/logout-redirect-files/languages');
}
}
示例11: __construct
/**
* PHP 5 Constructor
*
* @since 1.0
*/
function __construct()
{
global $wp_version;
if (defined('WPMU_PLUGIN_DIR') && strpos(__FILE__, WPMU_PLUGIN_DIR) === false) {
$this->thispluginpath = WP_PLUGIN_DIR . '/' . dirname(plugin_basename(__FILE__)) . '/';
$this->thispluginurl = WP_PLUGIN_URL . '/' . dirname(plugin_basename(__FILE__)) . '/';
load_plugin_textdomain($this->localization_domain, false, dirname(plugin_basename(__FILE__)) . '/languages/');
} else {
$this->thispluginpath = WPMU_PLUGIN_DIR . '/' . dirname(plugin_basename(__FILE__)) . '/';
$this->thispluginurl = WPMU_PLUGIN_URL . '/' . dirname(plugin_basename(__FILE__)) . '/';
load_muplugin_textdomain($this->localization_domain, '/blogtemplatesfiles/languages/');
}
$this->currenturl_with_querystring = is_ssl() ? 'https://' . $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI'] : 'http://' . $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI'];
// Initialize the options
$this->get_options();
// Add the super admin page
if (version_compare($wp_version, '3.0.9', '>')) {
add_action('network_admin_menu', array($this, 'network_admin_page'));
} else {
add_action('admin_menu', array($this, 'pre_3_1_network_admin_page'));
}
// Admin notices and data processing
add_action('network_admin_notices', array($this, 'admin_options_page_posted'));
add_action('admin_notices', array($this, 'admin_options_page_posted'));
// Actions
$action_order = defined('NBT_APPLY_TEMPLATE_ACTION_ORDER') && NBT_APPLY_TEMPLATE_ACTION_ORDER ? NBT_APPLY_TEMPLATE_ACTION_ORDER : 9999;
add_action('wpmu_new_blog', array($this, 'set_blog_defaults'), apply_filters('blog_templates-actions-action_order', $action_order), 6);
// Set to *very high* so this runs after every other action; also, accepts 6 params so we can get to meta
add_action('admin_footer', array($this, 'add_template_dd'));
add_action('wp_enqueue_scripts', create_function('', 'wp_enqueue_script("jquery");'));
// Special features for Multi-Domains
add_action('add_multi_domain_form_field', array($this, 'multi_domain_form_field'));
// add field to domain addition form
add_action('edit_multi_domain_form_field', array($this, 'multi_domain_form_field'));
// add field to domain edition form
add_filter('md_update_domain', array($this, 'multi_domain_update_domain'), 10, 2);
// saves blog template value on domain update
add_filter('manage_multi_domains_columns', array($this, 'manage_multi_domains_columns'));
// add column to multi domain table
add_action('manage_multi_domains_custom_column', array($this, 'manage_multi_domains_custom_column'), 10, 2);
// populate blog template column in multi domain table
add_action('blogs_directory_blogs_list', array($this, 'blogs_directory_blogs_list'));
// Signup: WordPress
add_action('signup_blogform', array($this, 'registration_template_selection'));
add_filter('add_signup_meta', array($this, 'registration_template_selection_add_meta'));
// Signup: BuddyPress
add_action('bp_after_blog_details_fields', array($this, 'registration_template_selection'));
add_filter('bp_signup_usermeta', array($this, 'registration_template_selection_add_meta'));
}
示例12: l10ni18n
/**
* Load CMB text domain
* @since 2.0.0
*/
public function l10ni18n()
{
$loaded = load_plugin_textdomain('cmb2', false, '/languages/');
if (!$loaded) {
$loaded = load_muplugin_textdomain('cmb2', '/languages/');
}
if (!$loaded) {
$loaded = load_theme_textdomain('cmb2', '/languages/');
}
if (!$loaded) {
$locale = apply_filters('plugin_locale', get_locale(), 'cmb2');
$mofile = dirname(__FILE__) . '/languages/cmb2-' . $locale . '.mo';
load_textdomain('cmb2', $mofile);
}
}
示例13: load_plugin_textdomain
/**
* Load translation file
*/
private function load_plugin_textdomain($lang_dir = 'languages')
{
// Check load
static $loaded;
if (isset($loaded)) {
return;
}
$loaded = true;
// Check if this plugin is placed in wp-content/mu-plugins directory or subdirectory
if (('mu-plugins' == basename(dirname(__FILE__)) || 'mu-plugins' == basename(dirname(dirname(__FILE__)))) && function_exists('load_muplugin_textdomain')) {
load_muplugin_textdomain($this->key, ('mu-plugins' == basename(dirname(__FILE__)) ? '' : basename(dirname(__FILE__)) . '/') . $lang_dir);
// Usual wp-content/plugins directory location
} else {
load_plugin_textdomain($this->key, false, basename(dirname(__FILE__)) . '/' . $lang_dir);
}
}
示例14: __construct
function __construct()
{
global $wp_version;
include_once 'external/wpmudev-dash-notification.php';
if (!function_exists('is_plugin_active_for_network')) {
require_once ABSPATH . '/wp-admin/includes/plugin.php';
}
//Check for backwards compatibility
$uploaddir = $this->upload_dir();
$login_image_old = $this->get_option('ub_login_image_url', false);
$login_image = $this->get_option('ub_login_image', false);
// Check for backwards compatibility
if (!isset($login_image_old) || $login_image_old == '') {
//there is no any old record
if (!$login_image) {
//add default image if not exists
$response = wp_remote_head(admin_url() . 'images/wordpress-logo.svg');
if (!is_wp_error($response) && !empty($response['response']['code']) && $response['response']['code'] == '200') {
//support for 3.8+
$this->update_option('ub_login_image', admin_url() . 'images/wordpress-logo.svg');
} else {
$this->update_option('ub_login_image', admin_url() . 'images/wordpress-logo.png');
// for older version
}
}
} else {
//there IS an OLD RECORD
$this->update_option('ub_login_image', $login_image_old);
//we will assume that file is in place
$this->update_option('ub_login_image_url', '');
}
add_action('admin_enqueue_scripts', array(&$this, 'admin_enqueues'));
add_action('admin_menu', array(&$this, 'add_admin_page'));
add_action('network_admin_menu', array(&$this, 'add_network_admin_page'));
if (defined('WPMU_PLUGIN_DIR') && file_exists(WPMU_PLUGIN_DIR . '/login-image.php')) {
load_muplugin_textdomain('login_image', 'languages');
} else {
load_plugin_textdomain('login_image', false, dirname(plugin_basename(__FILE__)) . '/languages');
}
add_action('admin_init', array(&$this, 'process'));
// Login interface
add_action('login_head', array(&$this, 'stylesheet'), 99);
if (!is_multisite()) {
add_filter('login_headerurl', array(&$this, 'home_url'));
}
}
示例15: localization
function localization()
{
// Load up the localization file if we're using WordPress in a different language
// Place it in this plugin's "languages" folder and name it "tc-[value in wp-config].mo"
if ($this->location == 'mu-plugins') {
load_muplugin_textdomain('tc-mollie', 'languages/');
} else {
if ($this->location == 'subfolder-plugins') {
//load_plugin_textdomain( 'tc-mollie', false, $this->plugin_dir . '/languages/' );
load_plugin_textdomain('tc-mollie', false, dirname(plugin_basename(__FILE__)) . '/languages/');
} else {
if ($this->location == 'plugins') {
load_plugin_textdomain('tc-mollie', false, 'languages/');
} else {
}
}
}
$temp_locales = explode('_', get_locale());
$this->language = $temp_locales[0] ? $temp_locales[0] : 'en';
}