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

PHP pll_register_string函数代码示例

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

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



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


示例16: register

 /**
  * Registers the string to the translation plugin.
  *
  * @param string $text The string to register to the multilingual plugin.
  * @param boolean $multiline True if multiline text, false otherwise.
  * @param string $context The context of the registered string.
  * @param string $identifier A unique identifier ie. plugin name
  */
 public function register($text, $multiline = false, $context = 'Buzz SEO', $identifier = 'buzz-seo')
 {
     pll_register_string($identifier, $text, $context, $multiline);
 }
开发者ID:nextbuzz,项目名称:buzz-seo,代码行数:12,代码来源:Polylang.php


示例17: icl_register_string

 function icl_register_string($context, $name, $string)
 {
     pll_register_string($name, $string);
 }
开发者ID:uoyknaht,项目名称:kc,代码行数:4,代码来源:api.php


示例18: registerShippingStringsForTranslation

 /**
  * Register shipping method custom titles in Polylang's Strings translations table.
  */
 public function registerShippingStringsForTranslation()
 {
     if (function_exists('pll_register_string')) {
         $shipping_methods = $this->getActiveShippingMethods();
         foreach ($shipping_methods as $method_id => $plugin_id) {
             $setting = get_option($plugin_id . $method_id . '_settings');
             if ($setting && isset($setting['title'])) {
                 pll_register_string($plugin_id . $method_id . '_shipping_method', $setting['title'], __('Woocommerce Shipping Methods', 'woo-poly-integration'));
             }
         }
     }
 }
开发者ID:hyyan,项目名称:woo-poly-integration,代码行数:15,代码来源:Shipping.php


示例19: registerStrings

 function registerStrings()
 {
     pll_register_string('Filmų registras', 'nuo');
     pll_register_string('Filmų registras', 'iki');
     pll_register_string('Filmų registras', 'Paieškos rezultatai');
     pll_register_string('Filmų registras', 'Pagal pasirinktus paieškos kriterijus filmų nerasta');
     pll_register_string('Filmų registras', 'Ieškoti');
     pll_register_string('Filmų registras', 'Prašome įvesti bent 1 paieškos kriterijų');
     pll_register_string('Filmų registras', 'identifikavimo kodą');
     pll_register_string('Filmų registras', 'pagaminimo datą');
     pll_register_string('Filmų registras', 'pavadinimą');
     pll_register_string('Filmų registras', 'rikiuoti pagal');
     pll_register_string('Filmų registras', 'Rikiuoti didėjimo tvarka');
     pll_register_string('Filmų registras', 'Rikiuoti mažėjimo tvarka');
     pll_register_string('Filmų registras', 'Įrašykite');
     pll_register_string('Filmų registras', 'Pasirinkite');
     pll_register_string('Filmų registras', 'Pridėti');
     pll_register_string('Filmų registras', 'Pašalinti');
     pll_register_string('Filmų registras', 'Grįžti į filmų paiešką');
     pll_register_string('Filmų registras', 'rodyti');
     pll_register_string('Filmų registras', 'visus');
     pll_register_string('Filmų registras', 'Filmas nepaskelbtas, negaliojantis arba išregistruotas');
 }
开发者ID:uoyknaht,项目名称:kc,代码行数:23,代码来源:lkc_film_register.php


示例20: add_action

    return $attachment_id;
}
add_action('init', 'transportation_posttype');
if (function_exists("pll_register_string")) {
    pll_register_string('Schedule', 'Програма');
    pll_register_string('Others', 'Други');
    pll_register_string('follow', 'Последвайте ни в:');
    pll_register_string('venue', 'VENUE_LOCATION');
    pll_register_string('venue_w', 'Място');
    pll_register_string('sponsors_w', 'Спонсори');
    pll_register_string('partners_w', 'Партньори');
    pll_register_string('speakers_w', 'Лектори');
    pll_register_string('time', 'EVENT_TIME');
    pll_register_string('publishedon', 'Публикувано на');
    pll_register_string('by_w', 'От');
    pll_register_string('see_whole_news', 'виж цялата новина');
    pll_register_string('news', 'Новини');
    pll_register_string('share_freedom', 'Да споделим свободата');
    pll_register_string('hall1', 'София');
    pll_register_string('hall2', 'Варна');
    pll_register_string('hall3', 'G1');
    pll_register_string('hall4', 'Пловдив');
    pll_register_string('hall5', 'Бургас');
    pll_register_string('bulgaria_hall', 'BULGARIA_HALL');
    pll_register_string('chamber_hall', 'CHAMBER_HALL');
    pll_register_string('music_hall', 'MUSIC_HALL');
    pll_register_string('low_quality', 'LOW_QUALITY');
    pll_register_string('normal_quality', 'NORMAL_QUALITY');
    pll_register_string('high_quality', 'HIGH_QUALITY');
    pll_register_string('all_streams', 'ALL_STREAMS');
}
开发者ID:user890104,项目名称:initfest,代码行数:31,代码来源:functions.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
PHP pll_the_languages函数代码示例发布时间:2022-05-15
下一篇:
PHP pll_languages_list函数代码示例发布时间: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