当前位置: 首页>>代码示例>>PHP>>正文


PHP pll_register_string函数代码示例

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


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

示例1: add_to_polylang_register

 /**
  * Add strings to polylang register.
  */
 protected function add_to_polylang_register($strings, $context)
 {
     if (!empty($strings)) {
         foreach ($strings as $string) {
             pll_register_string($string, $string, __('TTfP:', 'polylang-tt') . ' ' . $context);
         }
     }
 }
开发者ID:marcinkazmierski,项目名称:Polylang---theme-translation,代码行数:11,代码来源:polylang-theme-translation.php

示例2: register_strings

 /**
  * Registers theme_mod strings into Polylang
  *
  * @since 1.6.0
  */
 public function register_strings()
 {
     if (function_exists('pll_register_string') && ($strings = wpex_register_theme_mod_strings())) {
         foreach ($strings as $string => $default) {
             pll_register_string($string, get_theme_mod($string, $default), 'Theme Mod', true);
         }
     }
 }
开发者ID:iq007,项目名称:MadScape,代码行数:13,代码来源:polylang.php

示例3: register_string

 public function register_string($string)
 {
     if (function_exists('pll_register_string')) {
         pll_register_string($string, $string, 'WP Libre Form');
     } else {
         // Don't kill anything.
     }
 }
开发者ID:anttiviljami,项目名称:wp-libre-form,代码行数:8,代码来源:class-wplf-polylang.php

示例4: register_string

/**
 * Add registration for multilanguage string (contain hook)
 *
 * @since   1.0.0
 *
 * @param     string   $plugin_name_human_format  The Plugin name 
 * @param     string   $string_name               The name of the string
 * @param     string   $value					  The value
 */
function register_string($plugin_name_human_format, $string_name, $value)
{
    if (function_exists('icl_register_string')) {
        icl_register_string($plugin_name_human_format, $string_name, $value);
    } elseif (has_filter('cml_my_translations')) {
        add_filter('cml_my_translations', create_function("{$groups}, {$plugin_name_human_format}", "\n            {$plugin_name_human_format_replaced} = str_replace( ' ', '-', {$plugin_name_human_format} );\n            CMLTranslations:add( {$string_name}, {$value}, {$plugin_name_human_format} );\n            {$groups[$plugin_name_human_format_replaced]} = {$plugin_name_human_format};\n            return {$groups};"));
    } elseif (function_exists('pll_register_string')) {
        $plugin_name_human_format_replaced = str_replace(' ', '-', $plugin_name_human_format);
        pll_register_string($plugin_name_human_format_replaced, $string_name);
    }
}
开发者ID:Bqd,项目名称:WordPress-Plugin-Boilerplate-Powered,代码行数:20,代码来源:language.php

示例5: register_translations

 /**
  * Register translations.
  *
  * @param array $groups
  * @param bool $multiline
  *
  * @throws \BadFunctionCallException
  *
  * @return void
  */
 function register_translations(array $groups, $multiline = false)
 {
     if (!function_exists('pll_register_string')) {
         throw new BadFunctionCallException('Please active the Polylang plugin.');
     }
     foreach ($groups as $group => $translations) {
         foreach ($translations as $key => $description) {
             pll_register_string($description, $key, $group, $multiline);
         }
     }
 }
开发者ID:wordplate,项目名称:translator,代码行数:21,代码来源:helpers.php

示例6: register_string

 /**
  * Add registration for multilanguage string (contain hook)
  *
  * @since   1.0.0
  *
  * @param string $plugin_name_human_format The Plugin name .
  * @param string $string_name The name of the string.
  * @param string $value The value.
  */
 function register_string($plugin_name_human_format, $string_name, $value)
 {
     if (function_exists('icl_register_string')) {
         icl_register_string($plugin_name_human_format, $string_name, $value);
     } elseif (has_filter('cml_my_translations')) {
         CMLTranslations::add($string_name, $value, str_replace(' ', '-', $plugin_name_human_format));
     } elseif (function_exists('pll_register_string')) {
         $plugin_name_human_format_replaced = str_replace(' ', '-', $plugin_name_human_format);
         pll_register_string($plugin_name_human_format_replaced, $string_name);
     }
 }
开发者ID:wpbp,项目名称:language,代码行数:20,代码来源:language.php

示例7: manageAttrLablesTranslation

 /**
  * Make all attributes lables managed by polylang string translation
  *
  * @global \Polylang $polylang
  * @global \WooCommerce $woocommerce
  *
  * @return boolean false if polylang or woocommerce can not be found
  */
 public function manageAttrLablesTranslation()
 {
     global $polylang, $woocommerce;
     if (!$polylang || !$woocommerce) {
         return false;
     }
     $attrs = wc_get_attribute_taxonomies();
     $section = __('Woocommerce Attributes', 'woo-poly-integration');
     foreach ($attrs as $attr) {
         pll_register_string($attr->attribute_label, $attr->attribute_label, $section);
     }
 }
开发者ID:Frost-Bite,项目名称:woo-poly-integration,代码行数:20,代码来源:Attributes.php

示例8: ci_register_string_translation

 /**
  * Registers a string for translation. Needs a supported translation plugin active.
  * Parameters should be identical to respective calls of ci_get_string_translation()
  *
  * @param string $name A description of the value, e.g. 'Booking - Button Text'
  * @param string $value The text to be registered for translation, e.g. 'Book Now'
  * @param string $context A context for grouping and disambiguation of the value, e.g. 'Widgets'
  * @return string The string $value passed.
  */
 function ci_register_string_translation($name, $value, $context)
 {
     // WPML support
     if (function_exists('icl_register_string')) {
         icl_register_string($context, $name . ' - ' . md5($value), $value);
     } elseif (function_exists('pll_register_string')) {
         // Must be run in every pageload.
         pll_register_string($context . ' - ' . $name, $value);
     }
     // qTranslate seems to be working out of the box.
     // Return the $value so that the function can be used in nested calls.
     // E.g.: $value = ci_register_string_translation( $name, sanitize_text_field($value), $context );
     return $value;
 }
开发者ID:nickolasnikolic,项目名称:wordpress-heroku-php,代码行数:23,代码来源:localization.php

示例9: register_strings

 public function register_strings()
 {
     if (!class_exists('GFAPI') || !function_exists('pll_register_string')) {
         return;
     }
     $forms = GFAPI::get_forms();
     foreach ($forms as $form) {
         $this->form = $form;
         $this->iterate_form($form, function ($value, $key) {
             $name = '';
             // todo: suitable naming
             $group = "Form #{$this->form['id']}: {$this->form['title']}";
             pll_register_string($name, $value, $group);
             $this->registered_strings[] = $value;
         });
     }
 }
开发者ID:pdme,项目名称:gravity-forms-polylang,代码行数:17,代码来源:class_GF_PLL.php

示例10: bookingwp_email_strings

 function bookingwp_email_strings()
 {
     $name = 'bookingwp-quoted-subject';
     $string = booking_get_option('bookingwp_quoted_email_subject');
     $group = 'bookingwp';
     $multiline = true;
     pll_register_string($name, $string, $group, $multiline);
     $name = 'bookingwp-quoted';
     $string = booking_get_option('bookingwp_quoted_email');
     $group = 'bookingwp';
     $multiline = true;
     pll_register_string($name, $string, $group, $multiline);
     $name = 'bookingwp-refused-subject';
     $string = booking_get_option('bookingwp_refused_email_subject');
     $group = 'bookingwp';
     $multiline = true;
     pll_register_string($name, $string, $group, $multiline);
     $name = 'bookingwp-refused';
     $string = booking_get_option('bookingwp_refused_email');
     $group = 'bookingwp';
     $multiline = true;
     pll_register_string($name, $string, $group, $multiline);
     $name = 'bookingwp-confirmed-email-subject';
     $string = booking_get_option('bookingwp_confirmed_email_subject');
     $group = 'bookingwp';
     $multiline = true;
     pll_register_string($name, $string, $group, $multiline);
     $name = 'bookingwp-confirmed';
     $string = booking_get_option('bookingwp_confirmed_email');
     $group = 'bookingwp';
     $multiline = true;
     pll_register_string($name, $string, $group, $multiline);
     $name = 'bookingwp-confirm-button';
     $string = booking_get_option('bookingwp_confirm_button');
     $group = 'bookingwp';
     $multiline = true;
     pll_register_string($name, $string, $group, $multiline);
     $name = 'bookingwp-cancellation-policy';
     $string = booking_get_option('bookingwp_cancellation_policy');
     $group = 'bookingwp';
     $multiline = true;
     pll_register_string($name, $string, $group, $multiline);
 }
开发者ID:bulini,项目名称:booking-wp,代码行数:43,代码来源:custom-functions.php

示例11: tc_pll_strings_setup

 function tc_pll_strings_setup()
 {
     // grab theme options
     $tc_options = tc__f('__options');
     // grab settings map, useful for some options labels
     $tc_settings_map = TC_utils_settings_map::$instance->tc_get_customizer_map($get_default = true);
     $tc_controls_map = $tc_settings_map['add_setting_control'];
     // set $polylang_group;
     $polylang_group = 'customizr-pro' == TC___::$theme_name ? 'Customizr-Pro' : 'Customizr';
     //get options to translate
     $tc_translatable_raw_options = TC_plugins_compat::$instance->tc_get_string_options_to_translate();
     $tc_pll_options = array();
     //build array if option => array( label (gettext-ed), option )
     foreach ($tc_translatable_raw_options as $tc_translatable_option) {
         if (isset($tc_options[$tc_translatable_option])) {
             switch ($tc_translatable_option) {
                 case 'tc_front_slider':
                     $label = __('Front page slider name', 'customizr');
                     break;
                 case 'tc_posts_slider_button_text':
                     $label = __('Posts slider button text', 'customizr');
                     break;
                 default:
                     $label = $tc_controls_map[$tc_translatable_option]['label'];
                     break;
             }
             //endswitch
             $tc_pll_options[$tc_translatable_option] = array('label' => $label, 'value' => $tc_options[$tc_translatable_option]);
         }
     }
     //register the strings to translate
     foreach ($tc_pll_options as $tc_pll_option) {
         pll_register_string($tc_pll_option['label'], $tc_pll_option['value'], $polylang_group);
     }
 }
开发者ID:zhaoshengloveqingqing,项目名称:blog,代码行数:35,代码来源:class-fire-plugins_compat.php

示例12: sydney_polylang

 function sydney_polylang()
 {
     for ($i = 1; $i <= 5; $i++) {
         pll_register_string('Slide title ' . $i, get_theme_mod('slider_title_' . $i), 'Sydney');
         pll_register_string('Slide subtitle ' . $i, get_theme_mod('slider_subtitle_' . $i), 'Sydney');
     }
     pll_register_string('Slider button text', get_theme_mod('slider_button_text'), 'Sydney');
     pll_register_string('Slider button URL', get_theme_mod('slider_button_url'), 'Sydney');
 }
开发者ID:kding0409,项目名称:kding0409.github.io,代码行数:9,代码来源:functions.php

示例13: registerStrings

 function registerStrings()
 {
     pll_register_string('Lithuanian films', 'Pasirinkite');
     pll_register_string('Lithuanian films', 'Ilgametražis');
     pll_register_string('Lithuanian films', 'Trumpametražis');
     pll_register_string('Lithuanian films', 'Spalvotas');
     pll_register_string('Lithuanian films', 'Nespalvotas');
     pll_register_string('Lithuanian films', 'Gaminamas');
     pll_register_string('Lithuanian films', 'Pagamintas');
     pll_register_string('Lithuanian films', 'Paieškos forma');
     pll_register_string('Lithuanian films', 'Filtruoti');
     pll_register_string('Lithuanian films', 'nuo');
     pll_register_string('Lithuanian films', 'iki');
     pll_register_string('Lithuanian films', 'Pagal pasirinktus paieškos kriterijus filmų nerasta');
     pll_register_string('Lithuanian films', 'Rasta filmų');
     foreach ($this->fields as $key => $val) {
         pll_register_string('Lithuanian films', $val['label']);
     }
 }
开发者ID:uoyknaht,项目名称:kc,代码行数:19,代码来源:lkc_lithuanian_films.php

示例14: registerGatewayStringsForTranslation

 /**
  * Register Woocommerce Payment Gateway custom titles, descriptions and
  * instructions in Polylang's Strings translations table.
  */
 public function registerGatewayStringsForTranslation()
 {
     if (function_exists('pll_register_string') && !empty($this->enabledGateways)) {
         foreach ($this->enabledGateways as $gateway) {
             $settings = get_option($gateway->plugin_id . $gateway->id . '_settings');
             if (!empty($settings)) {
                 if (isset($settings['title'])) {
                     pll_register_string($gateway->plugin_id . $gateway->id . '_gateway_title', $settings['title'], __('Woocommerce Payment Gateways', 'woo-poly-integration'));
                 }
                 if (isset($settings['description'])) {
                     pll_register_string($gateway->plugin_id . $gateway->id . '_gateway_description', $settings['description'], __('Woocommerce Payment Gateways', 'woo-poly-integration'));
                 }
                 if (isset($settings['instructions'])) {
                     pll_register_string($gateway->plugin_id . $gateway->id . '_gateway_instructions', $settings['instructions'], __('Woocommerce Payment Gateways', 'woo-poly-integration'));
                 }
             }
         }
     }
 }
开发者ID:hyyan,项目名称:woo-poly-integration,代码行数:23,代码来源:Gateways.php

示例15: registerString

 /**
  * Register email subjects and headings strings for translation in Polylang
  * Strings Translations table.
  *
  * Note: This function uses get_option to retrive the subject and heading
  * string from the WooCommerce Admin Settings page. get_option will return false
  * if the Admin user has not changed (nor saved) the default settings.
  *
  * @param string $email_type Email type
  * @param string $sufix      Additional string variation, e.g. invoice paid vs invoice
  */
 public function registerString($email_type, $sufix = '')
 {
     if (function_exists('pll_register_string')) {
         $settings = get_option('woocommerce_' . $email_type . '_settings');
         if ($settings) {
             if (isset($settings['subject' . $sufix]) && isset($settings['heading' . $sufix])) {
                 pll_register_string('woocommerce_' . $email_type . '_subject' . $sufix, $settings['subject' . $sufix], __('Woocommerce Emails', 'woo-poly-integration'));
                 pll_register_string('woocommerce_' . $email_type . '_heading' . $sufix, $settings['heading' . $sufix], __('Woocommerce Emails', 'woo-poly-integration'));
             }
         }
     }
 }
开发者ID:hyyan,项目名称:woo-poly-integration,代码行数:23,代码来源:Emails.php


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