當前位置: 首頁>>代碼示例>>PHP>>正文


PHP pll__函數代碼示例

本文整理匯總了PHP中pll__函數的典型用法代碼示例。如果您正苦於以下問題:PHP pll__函數的具體用法?PHP pll__怎麽用?PHP pll__使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了pll__函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: wpmtst_l10n_polylang

/**
 * Polylang
 *
 * @param $string
 * @param $context
 * @param $name
 *
 * @return bool|string|void
 */
function wpmtst_l10n_polylang($string, $context, $name)
{
    if (function_exists('pll__')) {
        return pll__($string);
    }
    return $string;
}
開發者ID:serker72,項目名稱:T3S,代碼行數:16,代碼來源:l10n.php

示例2: translate_strings

 public function translate_strings($form)
 {
     if (function_exists('pll__')) {
         $this->iterate_form($form, function (&$value, $key) {
             $value = pll__($value);
         });
     }
     return $form;
 }
開發者ID:pdme,項目名稱:gravity-forms-polylang,代碼行數:9,代碼來源:class_GF_PLL.php

示例3: email_instructions

 /**
  * Add content to the WC emails.
  *
  * Note: The difference from WC_Gateway_BACS is that we use __() before
  * passing the string through wptexturize() and wpautop().
  *
  * @param WC_Order $order
  * @param bool     $sent_to_admin
  * @param bool     $plain_text
  */
 public function email_instructions($order, $sent_to_admin, $plain_text = false)
 {
     if (!$sent_to_admin && 'bacs' === $order->payment_method && $order->has_status('on-hold')) {
         if ($this->instructions) {
             echo wpautop(wptexturize(function_exists('pll__') ? pll__($this->instructions) : __($this->instructions, 'woocommerce'))) . PHP_EOL;
         }
         $this->bank_details($order->id);
     }
 }
開發者ID:hyyan,項目名稱:woo-poly-integration,代碼行數:19,代碼來源:GatewayBACS.php

示例4: translate_string

 public function translate_string($string)
 {
     if (function_exists('pll__')) {
         return pll__($string);
     } else {
         return $string;
         // Don't kill anything.
     }
 }
開發者ID:anttiviljami,項目名稱:wp-libre-form,代碼行數:9,代碼來源:class-wplf-polylang.php

示例5: trans

 /**
  * Get translations by their strings.
  *
  * @param string $key
  * @param string|null $lang
  *
  * @throws \BadFunctionCallException
  *
  * @return string
  */
 function trans($key, $lang = null)
 {
     if (!function_exists('pll__')) {
         throw new BadFunctionCallException('Please active the Polylang plugin.');
     }
     if ($lang) {
         return pll_translate_string($key, $lang);
     }
     return pll__($key);
 }
開發者ID:wordplate,項目名稱:translator,代碼行數:20,代碼來源:helpers.php

示例6: get_string

/**
 * Get multilanguage string
 *
 * @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 get_string($plugin_name_human_format, $string_name, $value)
{
    if (function_exists('icl_t')) {
        return icl_t($plugin_name_human_format, $string_name, $value);
    } elseif (has_filter('cml_my_translations')) {
        return CMLTranslations::get(CMLLanguage::get_current_id(), $string_name, str_replace(' ', '-', $plugin_name_human_format));
    } elseif (function_exists('pll__')) {
        return pll__($string_name);
    } else {
        return $value;
    }
}
開發者ID:Bqd,項目名稱:WordPress-Plugin-Boilerplate-Powered,代碼行數:21,代碼來源:language.php

示例7: ci_get_string_translation

 /**
  * Retrieves the translation for a string, if available. Needs a supported translation plugin active.
  * Parameters should be identical to respective call of ci_register_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 A translation of $value if available, else $value.
  */
 function ci_get_string_translation($name, $value, $context)
 {
     $translation = $value;
     // WPML support
     if (function_exists('icl_t')) {
         $translation = icl_t($context, $name . ' - ' . md5($value), $value);
     } elseif (function_exists('pll__')) {
         // Doesn't work before the 'wp' action.
         $translation = pll__($value);
     }
     // qTranslate seems to be working out of the box.
     return $translation;
 }
開發者ID:nickolasnikolic,項目名稱:wordpress-heroku-php,代碼行數:22,代碼來源:localization.php

示例8: populateDropdownOptions

 function populateDropdownOptions()
 {
     foreach ($this->fields as $key => $val) {
         if ($val['metaType'] == 'taxonomy') {
             $this->fields[$key]['dropdownOptions'] = $this->getDropdownOptionsFromTaxonomy($val['taxonomySlug']);
         }
     }
     $this->fields['country']['dropdownOptions'] = $this->countryList;
     $this->fields['country']['dropdownOptions'][0] = pll__('Pasirinkite');
     $this->fields['license_territory']['dropdownOptions'] = $this->countryList;
     $this->fields['license_territory']['dropdownOptions'][0] = pll__('Pasirinkite');
     $this->fields['film_original_language']['dropdownOptions'] = $this->countryList22;
     $this->fields['film_original_language']['dropdownOptions'][0] = pll__('Pasirinkite');
     $this->fields['film_subtitle_language']['dropdownOptions'] = $this->countryList22;
     $this->fields['film_subtitle_language']['dropdownOptions'][0] = pll__('Pasirinkite');
 }
開發者ID:uoyknaht,項目名稱:kc,代碼行數:16,代碼來源:film-register-data.class.php

示例9: perth_header_text

/**
 * Header text
 */
function perth_header_text()
{
    if (!function_exists('pll_register_string')) {
        $header_text = get_theme_mod('header_text', 'Welcome to Perth');
        $button_left = get_theme_mod('button_left', 'Start here');
        $button_right = get_theme_mod('button_right', 'Read more');
    } else {
        $header_text = pll__(get_theme_mod('header_text', 'Welcome to Perth'));
        $button_left = pll__(get_theme_mod('button_left', 'Start here'));
        $button_right = pll__(get_theme_mod('button_right', 'Read more'));
    }
    $button_left_url = get_theme_mod('button_left_url', '#primary');
    $button_right_url = get_theme_mod('button_right_url', '#primary');
    echo '<div class="header-info">
			<h3 class="header-text">' . esc_html($header_text) . '</h3>
			<div class="header-buttons">';
    if ($button_left_url) {
        echo '<a class="button header-button left-button" href="' . esc_url($button_left_url) . '">' . esc_html($button_left) . '</a>';
    }
    if ($button_right_url) {
        echo '<a class="button header-button right-button" href="' . esc_url($button_right_url) . '">' . esc_html($button_right) . '</a>';
    }
    echo '</div>';
    echo '</div>';
}
開發者ID:c-o-l-o-r,項目名稱:ESUC-Website,代碼行數:28,代碼來源:functions.php

示例10: get_translation_string

 /**
  * Add translation strings to translatable strings
  *
  * @param array $parameter ["domain" => "wpsolr facel label", "name" => "categories", "text" => "my categories"]
  */
 function get_translation_string($string, $parameter)
 {
     if (empty($parameter['language'])) {
         // Translate with current language
         $result = pll__($parameter['name']);
     } else {
         // Translate with parameter language
         $result = pll_translate_string($parameter['name'], $parameter['language']);
     }
     return $result;
 }
開發者ID:silvestrelosada,項目名稱:wpsolr-search-engine,代碼行數:16,代碼來源:plugin-polylang.php

示例11: icl_translate

 function icl_translate($context, $name, $string, $bool = false)
 {
     PLL_WPML_Compat::instance()->register_string($context, $name, $string);
     return pll__($string);
 }
開發者ID:spielhoelle,項目名稱:amnesty,代碼行數:5,代碼來源:wpml-compat.php

示例12: pll_translate_string

function pll_translate_string($string, $lang)
{
    if (pll_current_language() == $lang) {
        return pll__($string);
    }
    static $cache;
    // cache object to avoid loading the same translations object several times
    if (empty($cache)) {
        $cache = new PLL_Cache();
    }
    if (false === ($mo = $cache->get($lang))) {
        $mo = new PLL_MO();
        $mo->import_from_db(PLL()->model->get_language($lang));
        $cache->set($lang, $mo);
    }
    return $mo->translate($string);
}
開發者ID:iq007,項目名稱:MadScape,代碼行數:17,代碼來源:api.php

示例13: translate_strings_recursive

 protected function translate_strings_recursive($strings, $values)
 {
     foreach ($values as $name => $value) {
         if (isset($strings[$name])) {
             if (is_string($value) && $strings[$name] == 1) {
                 $values[$name] = pll__($value);
             } elseif (is_array($value) && is_array($strings[$name])) {
                 $values[$name] = $this->translate_strings_recursive($strings[$name], $value);
             }
         }
     }
     return $values;
 }
開發者ID:MaryMaffka,項目名稱:dpm,代碼行數:13,代碼來源:wpml-compat.php

示例14: addEndpoints

 /**
  * Add endpoints
  *
  * Add all endpoints translation in the current langauge
  */
 public function addEndpoints()
 {
     foreach ($this->endpoints as $endpoint) {
         add_rewrite_endpoint(pll__($endpoint), EP_ROOT | EP_PAGES);
     }
 }
開發者ID:decarvalhoaa,項目名稱:woopoly,代碼行數:11,代碼來源:Endpoints.php

示例15: get_header

<?php

get_header();
?>
<section class="content">
	<?php 
echo do_shortcode('[sh-latest-posts cat="news" label="' . pll__('Новини') . '"]');
?>
<div class="separator"></div>
<div class="col-right sponsors sponsors-frontpage">
    <?php 
echo do_shortcode('[sponsors]');
?>
    <?php 
echo do_shortcode('[partners]');
?>
</div>
<div class="separator"></div>
</section>

<?php 
echo do_shortcode('[transport]');
?>

<?php 
get_footer();
開發者ID:qweqq,項目名稱:initfest,代碼行數:26,代碼來源:front-page.php


注:本文中的pll__函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。