• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP is_textdomain_loaded函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中is_textdomain_loaded函数的典型用法代码示例。如果您正苦于以下问题:PHP is_textdomain_loaded函数的具体用法?PHP is_textdomain_loaded怎么用?PHP is_textdomain_loaded使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了is_textdomain_loaded函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: wpcf7_load_textdomain

function wpcf7_load_textdomain($locale = null)
{
    global $l10n;
    $domain = 'contact-form-7';
    if (get_locale() == $locale) {
        $locale = null;
    }
    if (empty($locale)) {
        if (is_textdomain_loaded($domain)) {
            return true;
        } else {
            return load_plugin_textdomain($domain, false, $domain . '/languages');
        }
    } else {
        $mo_orig = $l10n[$domain];
        unload_textdomain($domain);
        $mofile = $domain . '-' . $locale . '.mo';
        $path = WP_PLUGIN_DIR . '/' . $domain . '/languages';
        if ($loaded = load_textdomain($domain, $path . '/' . $mofile)) {
            return $loaded;
        } else {
            $mofile = WP_LANG_DIR . '/plugins/' . $mofile;
            return load_textdomain($domain, $mofile);
        }
        $l10n[$domain] = $mo_orig;
    }
    return false;
}
开发者ID:StefanBonilla,项目名称:CoupSoup,代码行数:28,代码来源:l10n.php


示例2: init

 public function init()
 {
     $this->title($this->tab);
     if (!is_textdomain_loaded('debug-bar-actions-and-filters-addon')) {
         load_plugin_textdomain('debug-bar-actions-and-filters-addon', false, dirname(plugin_basename(__FILE__)) . '/languages');
     }
     add_action('wp_enqueue_scripts', array($this, 'enqueue_scripts'));
     add_action('admin_enqueue_scripts', array($this, 'enqueue_scripts'));
 }
开发者ID:butuzov,项目名称:wp-debug-bar-actions-and-filters-addon,代码行数:9,代码来源:class-debug-bar-action-and-filters-addon.php


示例3: __construct

 function __construct()
 {
     //@see https://core.trac.wordpress.org/ticket/10527
     if (!is_textdomain_loaded('breadcrumb-navxt')) {
         load_plugin_textdomain('breadcrumb-navxt', false, 'breadcrumb-navxt/languages');
     }
     $ops = array('classname' => 'widget_breadcrumb_navxt', 'description' => __('Adds a breadcrumb trail to your sidebar', 'breadcrumb-navxt'));
     parent::__construct('bcn_widget', 'Breadcrumb NavXT', $ops);
 }
开发者ID:jesusmarket,项目名称:jesusmarket,代码行数:9,代码来源:class.bcn_widget.php


示例4: test_is_textdomain_loaded_for_no_translations

 /**
  * @ticket 21319
  */
 function test_is_textdomain_loaded_for_no_translations()
 {
     $this->assertFalse(load_textdomain('wp-tests-domain', DIR_TESTDATA . '/non-existent-file'));
     $this->assertFalse(is_textdomain_loaded('wp-tests-domain'));
     $this->assertInstanceOf('NOOP_Translations', get_translations_for_domain('wp-tests-domain'));
     // Ensure that we don't confuse NOOP_Translations to be a loaded text domain.
     $this->assertFalse(is_textdomain_loaded('wp-tests-domain'));
     $this->assertFalse(unload_textdomain('wp-tests-domain'));
 }
开发者ID:boonebgorges,项目名称:wp,代码行数:12,代码来源:l10n.php


示例5: __construct

 public function __construct()
 {
     //@see https://core.trac.wordpress.org/ticket/10527
     if (!is_textdomain_loaded('breadcrumb-navxt')) {
         load_plugin_textdomain('breadcrumb-navxt', false, 'breadcrumb-navxt/languages');
     }
     $this->trail =& $this->breadcrumbs;
     //Initilize with default option values
     $this->opt = array('bmainsite_display' => true, 'Hmainsite_template' => bcn_breadcrumb::get_default_template(), 'Hmainsite_template_no_anchor' => bcn_breadcrumb::default_template_no_anchor, 'bhome_display' => true, 'Hhome_template' => bcn_breadcrumb::get_default_template(), 'Hhome_template_no_anchor' => bcn_breadcrumb::default_template_no_anchor, 'bblog_display' => true, 'Hblog_template' => bcn_breadcrumb::get_default_template(), 'Hblog_template_no_anchor' => bcn_breadcrumb::default_template_no_anchor, 'hseparator' => ' &gt; ', 'blimit_title' => false, 'amax_title_length' => 20, 'bcurrent_item_linked' => false, 'Hpost_page_template' => bcn_breadcrumb::get_default_template(), 'Hpost_page_template_no_anchor' => bcn_breadcrumb::default_template_no_anchor, 'apost_page_root' => get_option('page_on_front'), 'Hpaged_template' => __('<span property="itemListElement" typeof="ListItem"><span property="name">Page %htitle%</span><meta property="position" content="%position%"></span>', 'breadcrumb-navxt'), 'bpaged_display' => false, 'Hpost_post_template' => bcn_breadcrumb::get_default_template(), 'Hpost_post_template_no_anchor' => bcn_breadcrumb::default_template_no_anchor, 'apost_post_root' => get_option('page_for_posts'), 'bpost_post_taxonomy_display' => true, 'Spost_post_taxonomy_type' => 'category', 'Hpost_attachment_template' => bcn_breadcrumb::get_default_template(), 'Hpost_attachment_template_no_anchor' => bcn_breadcrumb::default_template_no_anchor, 'H404_template' => bcn_breadcrumb::default_template_no_anchor, 'S404_title' => __('404', 'breadcrumb-navxt'), 'Hsearch_template' => __('<span property="itemListElement" typeof="ListItem"><span property="name">Search results for &#39;<a property="item" typeof="WebPage" title="Go to the first page of search results for %title%." href="%link%" class="%type%">%htitle%</a>&#39;</span><meta property="position" content="%position%"></span>', 'breadcrumb-navxt'), 'Hsearch_template_no_anchor' => __('<span property="itemListElement" typeof="ListItem"><span property="name">Search results for &#39;%htitle%&#39;</span><meta property="position" content="%position%"></span>', 'breadcrumb-navxt'), 'Htax_post_tag_template' => __('<span property="itemListElement" typeof="ListItem"><a property="item" typeof="WebPage" title="Go to the %title% tag archives." href="%link%" class="%type%"><span property="name">%htitle%</span></a><meta property="position" content="%position%"></span>', 'breadcrumb-navxt'), 'Htax_post_tag_template_no_anchor' => bcn_breadcrumb::default_template_no_anchor, 'Htax_post_format_template' => __('<span property="itemListElement" typeof="ListItem"><a property="item" typeof="WebPage" title="Go to the %title% archives." href="%link%" class="%type%"><span property="name">%htitle%</span></a><meta property="position" content="%position%"></span>', 'breadcrumb-navxt'), 'Htax_post_format_template_no_anchor' => bcn_breadcrumb::default_template_no_anchor, 'Hauthor_template' => __('<span property="itemListElement" typeof="ListItem"><span property="name">Articles by: <a title="Go to the first page of posts by %title%." href="%link%" class="%type%">%htitle%</a>', 'breadcrumb-navxt'), 'Hauthor_template_no_anchor' => __('<span property="itemListElement" typeof="ListItem"><span property="name">Articles by: %htitle%</span><meta property="position" content="%position%"></span>', 'breadcrumb-navxt'), 'Sauthor_name' => 'display_name', 'Htax_category_template' => __('<span property="itemListElement" typeof="ListItem"><a property="item" typeof="WebPage" title="Go to the %title% category archives." href="%link%" class="%type%"><span property="name">%htitle%</span></a><meta property="position" content="%position%"></span>', 'breadcrumb-navxt'), 'Htax_category_template_no_anchor' => bcn_breadcrumb::default_template_no_anchor, 'Hdate_template' => __('<span property="itemListElement" typeof="ListItem"><a property="item" typeof="WebPage" title="Go to the %title% archives." href="%link%" class="%type%"><span property="name">%htitle%</span></a><meta property="position" content="%position%"></span>', 'breadcrumb-navxt'), 'Hdate_template_no_anchor' => bcn_breadcrumb::default_template_no_anchor);
 }
开发者ID:EaseCloud,项目名称:wordpress,代码行数:10,代码来源:class.bcn_breadcrumb_trail.php


示例6: test_load_unload_textdomain

 function test_load_unload_textdomain()
 {
     $this->assertFalse(is_textdomain_loaded('wp-tests-domain'));
     $this->assertFalse(unload_textdomain('wp-tests-domain'));
     $file = DIR_TESTDATA . '/pomo/simple.mo';
     $this->assertTrue(load_textdomain('wp-tests-domain', $file));
     $this->assertTrue(is_textdomain_loaded('wp-tests-domain'));
     $this->assertTrue(unload_textdomain('wp-tests-domain'));
     $this->assertFalse(is_textdomain_loaded('wp-tests-domain'));
 }
开发者ID:nkeat12,项目名称:dv,代码行数:10,代码来源:l10n.php


示例7: test_theme_translation_should_be_translated_without_calling_load_theme_textdomain

 /**
  * @ticket 34114
  */
 public function test_theme_translation_should_be_translated_without_calling_load_theme_textdomain()
 {
     add_filter('locale', array($this, 'filter_set_locale_to_german'));
     switch_theme('internationalized-theme');
     include_once get_stylesheet_directory() . '/functions.php';
     $is_textdomain_loaded_before = is_textdomain_loaded('internationalized-theme');
     $expected_output = i18n_theme_test();
     $is_textdomain_loaded_after = is_textdomain_loaded('internationalized-theme');
     unload_textdomain('internationalized-theme');
     remove_filter('locale', array($this, 'filter_set_locale_to_german'));
     $this->assertFalse($is_textdomain_loaded_before);
     $this->assertSame('Das ist ein Dummy Theme', $expected_output);
     $this->assertTrue($is_textdomain_loaded_after);
 }
开发者ID:ntwb,项目名称:wordpress-travis,代码行数:17,代码来源:loadTextdomainJustInTime.php


示例8: bogo_languages

function bogo_languages()
{
    static $languages = array();
    static $textdomain_loaded = false;
    if ($languages && $textdomain_loaded) {
        return apply_filters('bogo_languages', $languages);
    }
    $languages = array('af' => __('Afrikaans', 'bogo'), 'am' => __('Amharic', 'bogo'), 'an' => __('Aragonese', 'bogo'), 'ar' => __('Arabic', 'bogo'), 'as' => __('Assamese', 'bogo'), 'az' => __('Azerbaijani', 'bogo'), 'be_BY' => __('Belarusian', 'bogo'), 'bg_BG' => __('Bulgarian', 'bogo'), 'bn_BD' => __('Bangla', 'bogo'), 'bn_IN' => __('Indian Bengali', 'bogo'), 'bo' => __('Tibetan', 'bogo'), 'bs_BA' => __('Bosnian', 'bogo'), 'ca' => __('Catalan', 'bogo'), 'ckb' => __('Central Kurdish', 'bogo'), 'co' => __('Corsican', 'bogo'), 'cs_CZ' => __('Czech', 'bogo'), 'cy' => __('Welsh', 'bogo'), 'da_DK' => __('Danish', 'bogo'), 'de_DE' => __('German', 'bogo'), 'de_DE_formal' => __('German (Formal)', 'bogo'), 'de_CH' => __('German (Switzerland)', 'bogo'), 'dv' => __('Dhivehi', 'bogo'), 'el' => __('Greek', 'bogo'), 'en_US' => __('English (United States)', 'bogo'), 'en_AU' => __('English (Australia)', 'bogo'), 'en_CA' => __('English (Canada)', 'bogo'), 'en_GB' => __('English (UK)', 'bogo'), 'eo' => __('Esperanto', 'bogo'), 'es_ES' => __('Spanish (Spain)', 'bogo'), 'es_CL' => __('Spanish (Chile)', 'bogo'), 'es_CO' => __('Spanish (Colombia)', 'bogo'), 'es_MX' => __('Spanish (Mexico)', 'bogo'), 'es_PE' => __('Spanish (Peru)', 'bogo'), 'es_VE' => __('Spanish (Venezuela)', 'bogo'), 'et' => __('Estonian', 'bogo'), 'eu' => __('Basque', 'bogo'), 'fa_IR' => __('Persian', 'bogo'), 'fi' => __('Finnish', 'bogo'), 'fo' => __('Faroese', 'bogo'), 'fr_FR' => __('French (France)', 'bogo'), 'fy' => __('Frisian', 'bogo'), 'ga' => __('Irish', 'bogo'), 'gd' => __('Scottish Gaelic', 'bogo'), 'gl_ES' => __('Galician', 'bogo'), 'gu' => __('Gujarati', 'bogo'), 'haz' => __('Hazaragi', 'bogo'), 'he_IL' => __('Hebrew', 'bogo'), 'hi_IN' => __('Hindi', 'bogo'), 'hr' => __('Croatian', 'bogo'), 'ht' => __('Haitian', 'bogo'), 'hu_HU' => __('Hungarian', 'bogo'), 'hy' => __('Armenian', 'bogo'), 'id_ID' => __('Indonesian', 'bogo'), 'is_IS' => __('Icelandic', 'bogo'), 'it_IT' => __('Italian', 'bogo'), 'ja' => __('Japanese', 'bogo'), 'jv_ID' => __('Javanese', 'bogo'), 'ka_GE' => __('Georgian', 'bogo'), 'kk' => __('Kazakh', 'bogo'), 'km_KH' => __('Khmer', 'bogo'), 'kn' => __('Kannada', 'bogo'), 'ko_KR' => __('Korean', 'bogo'), 'li' => __('Limburgish', 'bogo'), 'lo' => __('Lao', 'bogo'), 'lt_LT' => __('Lithuanian', 'bogo'), 'lv' => __('Latvian', 'bogo'), 'mg_MG' => __('Malagasy', 'bogo'), 'mk_MK' => __('Macedonian', 'bogo'), 'ml_IN' => __('Malayalam', 'bogo'), 'mn' => __('Mongolian', 'bogo'), 'mr' => __('Marathi', 'bogo'), 'ms_MY' => __('Malay', 'bogo'), 'mt_MT' => __('Maltese', 'bogo'), 'my_MM' => __('Burmese', 'bogo'), 'nb_NO' => __('Norwegian (Bokmål)', 'bogo'), 'ne_NP' => __('Nepali', 'bogo'), 'ni_ID' => __('Nias', 'bogo'), 'nl_NL' => __('Dutch', 'bogo'), 'nn_NO' => __('Norwegian (Nynorsk)', 'bogo'), 'oci' => __('Occitan', 'bogo'), 'os' => __('Ossetic', 'bogo'), 'pa_IN' => __('Punjabi', 'bogo'), 'pl_PL' => __('Polish', 'bogo'), 'ps' => __('Pashto', 'bogo'), 'pt_BR' => __('Portuguese (Brazil)', 'bogo'), 'pt_PT' => __('Portuguese (Portugal)', 'bogo'), 'ro_RO' => __('Romanian', 'bogo'), 'ru_RU' => __('Russian', 'bogo'), 'sa_IN' => __('Sanskrit', 'bogo'), 'si_LK' => __('Sinhala', 'bogo'), 'sk_SK' => __('Slovak', 'bogo'), 'sl_SI' => __('Slovenian', 'bogo'), 'so_SO' => __('Somali', 'bogo'), 'sq' => __('Albanian', 'bogo'), 'sr_RS' => __('Serbian', 'bogo'), 'sv_SE' => __('Swedish', 'bogo'), 'su_ID' => __('Sundanese', 'bogo'), 'sw' => __('Swahili', 'bogo'), 'ta_IN' => __('Tamil', 'bogo'), 'te' => __('Telugu', 'bogo'), 'tg' => __('Tajik', 'bogo'), 'th' => __('Thai', 'bogo'), 'tl' => __('Tagalog', 'bogo'), 'tr_TR' => __('Turkish', 'bogo'), 'tt_RU' => __('Tatar', 'bogo'), 'ug_CN' => __('Uighur', 'bogo'), 'uk' => __('Ukrainian', 'bogo'), 'ur' => __('Urdu', 'bogo'), 'uz_UZ' => __('Uzbek', 'bogo'), 'vi' => __('Vietnamese', 'bogo'), 'zh_CN' => __('Chinese (China)', 'bogo'), 'zh_TW' => __('Chinese (Taiwan)', 'bogo'));
    if (is_textdomain_loaded('bogo')) {
        $textdomain_loaded = true;
    }
    asort($languages, SORT_STRING);
    return apply_filters('bogo_languages', $languages);
}
开发者ID:karthikakamalanathan,项目名称:wp-cookieLawInfo,代码行数:14,代码来源:functions.php


示例9: __construct

 private function __construct()
 {
     if (defined('DOING_CRON') || !current_user_can('backwpup') || !is_admin_bar_showing() || !get_site_option('backwpup_cfg_showadminbar')) {
         return;
     }
     //load text domain
     if (!is_textdomain_loaded('backwpup')) {
         load_plugin_textdomain('backwpup', FALSE, BackWPup::get_plugin_data('BaseName') . '/languages');
     }
     //add admin bar. Works only in init
     add_action('admin_bar_menu', array($this, 'adminbar'), 100);
     //admin css
     add_action('wp_head', array('BackWPup_Admin', 'admin_head'));
 }
开发者ID:isrealconsulting,项目名称:site,代码行数:14,代码来源:class-adminbar.php


示例10: init

 /**
  * Constructor.
  */
 public function init()
 {
     if (!class_exists('Debug_Bar_Pretty_Output') && class_exists('Debug_Bar_Panel')) {
         require_once plugin_dir_path(__FILE__) . 'inc/debug-bar-pretty-output/class-debug-bar-pretty-output.php';
     }
     if (!class_exists('Debug_Bar_List_PHP_Classes')) {
         require_once plugin_dir_path(__FILE__) . 'inc/debug-bar-pretty-output/class-debug-bar-list-php-classes.php';
     }
     if (!is_textdomain_loaded(self::DBC_NAME)) {
         load_plugin_textdomain(self::DBC_NAME, false, dirname(plugin_basename(__FILE__)) . '/languages');
     }
     add_action('wp_enqueue_scripts', array($this, 'enqueue_scripts'));
     add_action('admin_enqueue_scripts', array($this, 'enqueue_scripts'));
 }
开发者ID:butuzov,项目名称:wp-debug-bar-constants,代码行数:17,代码来源:class-debug-bar-constants.php


示例11: fix_woocommerce

 /**
  * Fix for WooCommerce so it can handle custom admin language without breaking non-admin pages.
  *
  * @return bool   If true set_language will use site language, otherwise custom language.
  */
 public function fix_woocommerce()
 {
     // Check if WooCommerce is active.
     $active_plugins = get_option('active_plugins');
     if (is_multisite()) {
         $active_plugins = array_merge($active_plugins, array_keys(get_site_option('active_sitewide_plugins')));
     }
     if (!in_array('woocommerce/woocommerce.php', apply_filters('active_plugins', $active_plugins), true)) {
         return false;
     }
     if (function_exists('is_ajax') && is_ajax() || !empty($_GET['wc-ajax'])) {
         return true;
     }
     // @codingStandardsIgnoreStart - Ignore rule against processing postdata without nonce
     if (isset($_POST['wc_order_action'])) {
         return true;
     }
     // @codingStandardsIgnoreEnd
     // Do not translate WooCommerce when creating pages or upgrade langs
     if (!empty($_GET['page']) && $_GET['page'] === 'wc-settings' && !empty($_GET['install_woocommerce_pages']) || !empty($_GET['page']) && $_GET['page'] === 'wc-status' && !empty($_GET['action']) && $_GET['action'] === 'install_pages' || !empty($_GET['page']) && $_GET['page'] === 'wc-status' && !empty($_GET['action']) && $_GET['action'] === 'translation_upgrade') {
         return true;
     }
     // Set WooCommerce permalinks to site language if not set. Will otherwise break permalinks.
     $this->return_original = true;
     $permalinks = get_option('woocommerce_permalinks');
     if (empty($permalinks)) {
         $permalinks = [];
     }
     $was_loaded = false;
     if (empty($permalinks['category_base']) || empty($permalinks['tag_base'])) {
         if (is_textdomain_loaded('woocommerce')) {
             $was_loaded = true;
         }
         load_plugin_textdomain('woocommerce', false, WP_PLUGIN_DIR . '/woocommerce/i18n/languages');
         if (empty($permalinks['category_base'])) {
             $permalinks['category_base'] = _x('product-category', 'slug', 'woocommerce');
         }
         if (empty($permalinks['tag_base'])) {
             $permalinks['tag_base'] = _x('product-tag', 'slug', 'woocommerce');
         }
         update_option('woocommerce_permalinks', $permalinks);
         unload_textdomain('woocommerce');
     }
     $this->return_original = false;
     // Reload WooCommerce textdomain
     if ($was_loaded) {
         load_plugin_textdomain('woocommerce', false, WP_PLUGIN_DIR . '/woocommerce/i18n/languages');
     }
 }
开发者ID:rasmusbe,项目名称:custom-admin-language,代码行数:54,代码来源:custom-admin-language.php


示例12: init

 public function init()
 {
     // bail if the plugin is in network mode
     if ($this->args['network']) {
         return;
     }
     // gPlugin Local:
     // if ( ! is_textdomain_loaded( GPLUGIN_TEXTDOMAIN ) )
     // 	load_plugin_textdomain( GPLUGIN_TEXTDOMAIN, FALSE, 'gplugin/languages' );
     // Parent Plugin Local:
     if (!is_textdomain_loaded($this->args['domain'])) {
         $this->load_textdomain();
     }
     // init here to help filtering the templates
     if (isset($this->constants['class_mustache'])) {
         call_user_func(array($this->constants['class_mustache'], 'init'));
     }
 }
开发者ID:geminorum,项目名称:gmember,代码行数:18,代码来源:componentcore.class.php


示例13: __construct

 /**
  *
  * Set needed filters and actions and load all needed
  *
  * @return \BackWPup_Admin
  */
 public function __construct()
 {
     //Load text domain
     if (!is_textdomain_loaded('backwpup')) {
         load_plugin_textdomain('backwpup', FALSE, BackWPup::get_plugin_data('BaseName') . '/languages');
     }
     //Add menu pages
     add_filter('backwpup_admin_pages', array($this, 'admin_page_jobs'), 2);
     add_filter('backwpup_admin_pages', array($this, 'admin_page_editjob'), 3);
     add_filter('backwpup_admin_pages', array($this, 'admin_page_logs'), 4);
     add_filter('backwpup_admin_pages', array($this, 'admin_page_backups'), 5);
     add_filter('backwpup_admin_pages', array($this, 'admin_page_settings'), 6);
     add_filter('backwpup_admin_pages', array($this, 'admin_page_about'), 20);
     //Add Menu
     if (is_multisite()) {
         add_action('network_admin_menu', array($this, 'admin_menu'));
     } else {
         add_action('admin_menu', array($this, 'admin_menu'));
     }
     //add Plugin links
     add_filter('plugin_row_meta', array($this, 'plugin_links'), 10, 2);
     //add more actions
     add_action('admin_init', array($this, 'admin_init'));
     //add more actions
     add_action('admin_head', array($this, 'admin_head'));
     //Save Form posts general
     add_action('admin_post_backwpup', array($this, 'save_post_form'));
     //Admin Footer Text replacement
     add_filter('admin_footer_text', array($this, 'admin_footer_text'), 100);
     add_filter('update_footer', array($this, 'update_footer'), 100);
     //User Profile fields
     add_action('show_user_profile', array($this, 'user_profile_fields'));
     add_action('edit_user_profile', array($this, 'user_profile_fields'));
     add_action('profile_update', array($this, 'save_profile_update'));
     add_filter('editable_roles', array($this, 'editable_roles'));
     add_filter('manage_users_columns', array($this, 'manage_users_columns'));
     add_filter('manage_users_custom_column', array($this, 'manage_users_custom_column'), 10, 3);
     //Change Backup message on core updates
     add_filter('gettext', array($this, 'gettext'), 10, 3);
     //Plugin banner free
     /*if ( ! class_exists( 'BackWPup_Pro', FALSE ) )
     		add_action( 'admin_notices', array( $this, 'get_pro_banner' ) );*/
 }
开发者ID:congtrieu112,项目名称:anime,代码行数:49,代码来源:class-admin.php


示例14: create


//.........这里部分代码省略.........
         $this->log_level = 'normal_translated';
     }
     //create log file
     $head = '';
     $info = '';
     $head .= "<!DOCTYPE html>" . PHP_EOL;
     $head .= "<html lang=\"" . str_replace('_', '-', get_locale()) . "\">" . PHP_EOL;
     $head .= "<head>" . PHP_EOL;
     $head .= "<meta charset=\"" . get_bloginfo('charset') . "\" />" . PHP_EOL;
     $head .= "<title>" . sprintf(__('BackWPup log for %1$s from %2$s at %3$s', 'backwpup'), $this->job['name'], date_i18n(get_option('date_format')), date_i18n(get_option('time_format'))) . "</title>" . PHP_EOL;
     $head .= "<meta name=\"robots\" content=\"noindex, nofollow\" />" . PHP_EOL;
     $head .= "<meta name=\"copyright\" content=\"Copyright &copy; 2012 - " . date('Y') . " Inpsyde GmbH\" />" . PHP_EOL;
     $head .= "<meta name=\"author\" content=\"Inpsyde GmbH\" />" . PHP_EOL;
     $head .= "<meta name=\"generator\" content=\"BackWPup " . BackWPup::get_plugin_data('Version') . "\" />" . PHP_EOL;
     $head .= "<meta http-equiv=\"cache-control\" content=\"no-cache\" />" . PHP_EOL;
     $head .= "<meta http-equiv=\"pragma\" content=\"no-cache\" />" . PHP_EOL;
     $head .= "<meta name=\"date\" content=\"" . date('c') . "\" />" . PHP_EOL;
     $head .= str_pad('<meta name="backwpup_errors" content="0" />', 100) . PHP_EOL;
     $head .= str_pad('<meta name="backwpup_warnings" content="0" />', 100) . PHP_EOL;
     $head .= "<meta name=\"backwpup_jobid\" content=\"" . $this->job['jobid'] . "\" />" . PHP_EOL;
     $head .= "<meta name=\"backwpup_jobname\" content=\"" . esc_attr($this->job['name']) . "\" />" . PHP_EOL;
     $head .= "<meta name=\"backwpup_jobtype\" content=\"" . implode('+', $this->job['type']) . "\" />" . PHP_EOL;
     $head .= str_pad('<meta name="backwpup_backupfilesize" content="0" />', 100) . PHP_EOL;
     $head .= str_pad('<meta name="backwpup_jobruntime" content="0" />', 100) . PHP_EOL;
     $head .= '</head>' . PHP_EOL;
     $head .= '<body style="margin:0;padding:3px;font-family:monospace;font-size:12px;line-height:15px;background-color:black;color:#c0c0c0;white-space:nowrap;">' . PHP_EOL;
     $info .= sprintf(_x('[INFO] %1$s %2$s; A project of Inpsyde GmbH', 'Plugin name; Plugin Version; plugin url', 'backwpup'), BackWPup::get_plugin_data('name'), BackWPup::get_plugin_data('Version'), __('http://backwpup.com', 'backwpup')) . '<br />' . PHP_EOL;
     $info .= sprintf(_x('[INFO] WordPress %1$s on %2$s', 'WordPress Version; Blog url', 'backwpup'), BackWPup::get_plugin_data('wp_version'), esc_attr(site_url('/'))) . '<br />' . PHP_EOL;
     $level = __('Normal', 'backwpup');
     $translated = '';
     if ($this->is_debug()) {
         $level = __('Debug', 'backwpup');
     }
     if (is_textdomain_loaded('backwpup')) {
         $translated = __('(translated)', 'backwpup');
     }
     $info .= sprintf(__('[INFO] Log Level: %1$s %2$s', 'backwpup'), $level, $translated) . '<br />' . PHP_EOL;
     $job_name = esc_attr($this->job['name']);
     if ($this->is_debug()) {
         $job_name .= '; ' . implode('+', $this->job['type']);
     }
     $info .= sprintf(__('[INFO] BackWPup job: %1$s', 'backwpup'), $job_name) . '<br />' . PHP_EOL;
     if ($this->is_debug()) {
         $current_user = wp_get_current_user();
         $info .= sprintf(__('[INFO] Runs with user: %1$s (%2$d) ', 'backwpup'), $current_user->user_login, $current_user->ID) . '<br />' . PHP_EOL;
     }
     if ($this->job['activetype'] === 'wpcron') {
         //check next run
         $cron_next = wp_next_scheduled('backwpup_cron', array('id' => $this->job['jobid']));
         if (!$cron_next || $cron_next < time()) {
             wp_unschedule_event($cron_next, 'backwpup_cron', array('id' => $this->job['jobid']));
             $cron_next = BackWPup_Cron::cron_next($this->job['cron']);
             wp_schedule_single_event($cron_next, 'backwpup_cron', array('id' => $this->job['jobid']));
             $cron_next = wp_next_scheduled('backwpup_cron', array('id' => $this->job['jobid']));
         }
         //output scheduling
         if ($this->is_debug()) {
             if (!$cron_next) {
                 $cron_next = __('Not scheduled!', 'backwpup');
             } else {
                 $cron_next = date_i18n('D, j M Y @ H:i', $cron_next + get_option('gmt_offset') * 3600, true);
             }
             $info .= sprintf(__('[INFO] Cron: %s; Next: %s ', 'backwpup'), $this->job['cron'], $cron_next) . '<br />' . PHP_EOL;
         }
     } elseif ($this->job['activetype'] == 'link' && $this->is_debug()) {
         $info .= __('[INFO] BackWPup job start with link is active', 'backwpup') . '<br />' . PHP_EOL;
开发者ID:skinnard,项目名称:FTL-2,代码行数:67,代码来源:class-job.php


示例15: load_text_domain

 /**
  * Load Plugin Translation
  *
  * @return bool Text domain loaded
  */
 public static function load_text_domain()
 {
     if (is_textdomain_loaded('backwpup')) {
         return TRUE;
     }
     return load_plugin_textdomain('backwpup', false, dirname(plugin_basename(__FILE__)) . '/languages');
 }
开发者ID:aim-web-projects,项目名称:kobe-chuoh,代码行数:12,代码来源:backwpup.php


示例16: load_text_domain

 /**
  * A Helper method to load text domain
  * First it tries to load the wp-content/languages translation then if falls to the
  * try to load $dir language files
  *
  * @param string $domain The text domain that will be loaded
  * @param string $dir    What directory should be used to try to load if the default doenst work
  *
  * @return bool  If it was able to load the text domain
  */
 public function load_text_domain($domain, $dir = false)
 {
     // Added safety just in case this runs twice...
     if (is_textdomain_loaded($domain) && !is_a($GLOBALS['l10n'][$domain], 'NOOP_Translations')) {
         return true;
     }
     $locale = get_locale();
     $mofile = WP_LANG_DIR . '/plugins/' . $domain . '-' . $locale . '.mo';
     /**
      * Allows users to filter which file will be loaded for a given text domain
      * Be careful when using this filter, it will apply across the whole plugin suite.
      *
      * @param string      $mofile The path for the .mo File
      * @param string      $domain Which plugin domain we are trying to load
      * @param string      $locale Which Language we will load
      * @param string|bool $dir    If there was a custom directory passed on the method call
      */
     $mofile = apply_filters('tribe_load_text_domain', $mofile, $domain, $locale, $dir);
     $loaded = load_plugin_textdomain($domain, false, $mofile);
     if ($dir !== false && !$loaded) {
         return load_plugin_textdomain($domain, false, $dir);
     }
     return $loaded;
 }
开发者ID:nullify005,项目名称:shcc-website,代码行数:34,代码来源:Main.php


示例17: load_textdomain

 /**
  * Load textdomain for internationalization.
  *
  * @since 1.0
  * @access public
  *
  * @uses is_textdomain_loaded() To check if translation is loaded.
  * @uses load_plugin_textdomain() To load translation file.
  * @uses plugin_basename() To get plugin's file name.
  */
 public function load_textdomain()
 {
     /* If translation isn't loaded, load it */
     if (!is_textdomain_loaded('nmi')) {
         load_plugin_textdomain('nmi', false, dirname(plugin_basename(__FILE__)) . '/languages');
     }
 }
开发者ID:vikman,项目名称:symbol-theme,代码行数:17,代码来源:nav-menu-images.php


示例18: test_should_allow_unloading_of_text_domain

 /**
  * @ticket 37113
  */
 public function test_should_allow_unloading_of_text_domain()
 {
     add_filter('locale', array($this, 'filter_set_locale_to_german'));
     require_once DIR_TESTDATA . '/plugins/internationalized-plugin.php';
     $expected_output_before = i18n_plugin_test();
     $is_textdomain_loaded_before = is_textdomain_loaded('internationalized-plugin');
     unload_textdomain('internationalized-plugin');
     remove_filter('locale', array($this, 'filter_set_locale_to_german'));
     $expected_output_after = i18n_plugin_test();
     $is_textdomain_loaded_after = is_textdomain_loaded('internationalized-plugin');
     add_filter('locale', array($this, 'filter_set_locale_to_german'));
     load_textdomain('internationalized-plugin', WP_LANG_DIR . '/plugins/internationalized-plugin-de_DE.mo');
     $expected_output_final = i18n_plugin_test();
     $is_textdomain_loaded_final = is_textdomain_loaded('internationalized-plugin');
     unload_textdomain('internationalized-plugin');
     remove_filter('locale', array($this, 'filter_set_locale_to_german'));
     // Text domain loaded just in time.
     $this->assertSame('Das ist ein Dummy Plugin', $expected_output_before);
     $this->assertTrue($is_textdomain_loaded_before);
     // Text domain unloaded.
     $this->assertSame('This is a dummy plugin', $expected_output_after);
     $this->assertFalse($is_textdomain_loaded_after);
     // Text domain loaded manually again.
     $this->assertSame('Das ist ein Dummy Plugin', $expected_output_final);
     $this->assertTrue($is_textdomain_loaded_final);
 }
开发者ID:aaemnnosttv,项目名称:develop.git.wordpress.org,代码行数:29,代码来源:loadTextdomainJustInTime.php


示例19: hybrid_extensions_gettext

/**
 * Filters 'gettext' to change the translations used for the each of the extensions' textdomains.  This filter 
 * makes it possible for the theme's MO file to translate the framework's extensions.
 *
 * @since 1.3.0
 * @access private
 * @param string $translated The translated text.
 * @param string $text The original, untranslated text.
 * @param string $domain The textdomain for the text.
 * @return string $translated
 */
function hybrid_extensions_gettext($translated, $text, $domain)
{
    /* Check if the current textdomain matches one of the framework extensions. */
    if (in_array($domain, array('breadcrumb-trail', 'custom-field-series', 'post-stylesheets', 'theme-layouts'))) {
        /* If the theme supports the extension, switch the translations. */
        if (current_theme_supports($domain)) {
            /* If the framework mofile is loaded, use its translations. */
            if (is_textdomain_loaded('hybrid-core')) {
                $translations =& get_translations_for_domain('hybrid-core');
            } elseif (is_textdomain_loaded(hybrid_get_parent_textdomain())) {
                $translations =& get_translations_for_domain(hybrid_get_parent_textdomain());
            }
            /* If translations were found, translate the text. */
            if (!empty($translations)) {
                $translated = $translations->translate($text);
            }
        }
    }
    return $translated;
}
开发者ID:nukulb,项目名称:bugsbounty-blog,代码行数:31,代码来源:i18n.php


示例20: load_textdomain

 /**
  * Load translations.
  *
  * @since 2.6.0
  *
  * (@internal Uses `load_theme_textdomain()` rather than `load_plugin_textdomain()` to
  * get round the different ways of handling the path and deprecated notices being thrown
  * and such. For plugins, the actual file name will be corrected by a filter.}}
  *
  * {@internal IMPORTANT! If this function changes, review the regex in the custom TGMPA
  * generator on the website.}}
  */
 public function load_textdomain()
 {
     if (is_textdomain_loaded('tgmpa')) {
         return;
     }
     if (false !== strpos(__FILE__, WP_PLUGIN_DIR) || false !== strpos(__FILE__, WPMU_PLUGIN_DIR)) {
         // Plugin, we'll need to adjust the file name.
         add_action('load_textdomain_mofile', array($this, 'correct_plugin_mofile'), 10, 2);
         load_theme_textdomain('tgmpa', dirname(__FILE__) . '/languages');
         remove_action('load_textdomain_mofile', array($this, 'correct_plugin_mofile'), 10);
     } else {
         load_theme_textdomain('tgmpa', dirname(__FILE__) . '/languages');
     }
 }
开发者ID:jesusmarket,项目名称:jesusmarket,代码行数:26,代码来源:class-tgm-plugin-activation.php



注:本文中的is_textdomain_loaded函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP is_time函数代码示例发布时间:2022-05-15
下一篇:
PHP is_term函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap