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


PHP Kirki_Toolkit::i18n方法代码示例

本文整理汇总了PHP中Kirki_Toolkit::i18n方法的典型用法代码示例。如果您正苦于以下问题:PHP Kirki_Toolkit::i18n方法的具体用法?PHP Kirki_Toolkit::i18n怎么用?PHP Kirki_Toolkit::i18n使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Kirki_Toolkit的用法示例。


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

示例1: to_json

 public function to_json()
 {
     parent::to_json();
     $this->json['choices'] = is_array($this->choices) ? array('top' => in_array('top', $this->choices) ? true : false, 'bottom' => in_array('bottom', $this->choices) ? true : false, 'left' => in_array('left', $this->choices) ? true : false, 'right' => in_array('right', $this->choices) ? true : false, 'units' => isset($this->choices['units']) ? $this->choices['units'] : false) : array();
     $i18n = Kirki_Toolkit::i18n();
     $this->json['l10n'] = array('top' => $i18n['top'], 'bottom' => $i18n['bottom'], 'left' => $i18n['left'], 'right' => $i18n['right']);
 }
开发者ID:ZmagoD,项目名称:kirki,代码行数:7,代码来源:class-kirki-controls-spacing-control.php

示例2: to_json

 public function to_json()
 {
     parent::to_json();
     $this->json['choices'] = array();
     if (is_array($this->choices)) {
         if (isset($this->choices['top']) && true == $this->choices['top']) {
             $this->json['choices']['top'] = true;
         }
         if (isset($this->choices['bottom']) && true == $this->choices['bottom']) {
             $this->json['choices']['bottom'] = true;
         }
         if (isset($this->choices['left']) && true == $this->choices['left']) {
             $this->json['choices']['left'] = true;
         }
         if (isset($this->choices['right']) && true == $this->choices['right']) {
             $this->json['choices']['right'] = true;
         }
     }
     $i18n = Kirki_Toolkit::i18n();
     $this->json['l10n'] = array('top' => $i18n['top'], 'bottom' => $i18n['bottom'], 'left' => $i18n['left'], 'right' => $i18n['right']);
     if (isset($this->json['choices']['top']) && !isset($this->json['value']['top'])) {
         $this->json['value']['top'] = $this->json['default']['top'];
     }
     if (isset($this->json['choices']['bottom']) && !isset($this->json['value']['bottom'])) {
         $this->json['value']['bottom'] = $this->json['default']['bottom'];
     }
     if (isset($this->json['choices']['left']) && !isset($this->json['value']['left'])) {
         $this->json['value']['left'] = $this->json['default']['left'];
     }
     if (isset($this->json['choices']['right']) && !isset($this->json['value']['top'])) {
         $this->json['value']['right'] = $this->json['default']['right'];
     }
 }
开发者ID:andrezrv,项目名称:kirki,代码行数:33,代码来源:class-kirki-controls-spacing-control.php

示例3: to_json

 public function to_json()
 {
     parent::to_json();
     $i18n = Kirki_Toolkit::i18n();
     $this->json['fonts'] = $this->get_all_fonts();
     $value = $this->value();
     $this->json['value'] = array('bold' => isset($value['bold']) ? $value['bold'] : false, 'italic' => isset($value['italic']) ? $value['italic'] : false, 'underline' => isset($value['underline']) ? $value['underline'] : false, 'strikethrough' => isset($value['strikethrough']) ? $value['strikethrough'] : false, 'font-family' => isset($value['font-family']) ? $value['font-family'] : '', 'font-size' => isset($value['font-size']) ? $value['font-size'] : '', 'font-weight' => isset($value['font-weight']) ? $value['font-weight'] : '', 'line-height' => isset($value['line-height']) ? $value['line-height'] : '', 'letter-spacing' => isset($value['letter-spacing']) ? $value['letter-spacing'] : '', 'color' => isset($value['color']) ? $value['color'] : '');
     $this->json['l10n'] = array('font-family' => $i18n['font-family'], 'font-size' => $i18n['font-size'], 'font-weight' => $i18n['font-weight'], 'line-height' => $i18n['line-height'], 'letter-spacing' => $i18n['letter-spacing'], 'color' => $i18n['color']);
 }
开发者ID:ragzor,项目名称:kirki,代码行数:9,代码来源:class-kirki-controls-typography-control.php

示例4: to_json

 public function to_json()
 {
     parent::to_json();
     $i18n = Kirki_Toolkit::i18n();
     $this->json['choices'] = empty($this->choices) || !is_array($this->choices) ? array() : $this->choices;
     $this->json['choices']['on'] = isset($this->choices['on']) ? $this->choices['on'] : $i18n['on'];
     $this->json['choices']['off'] = isset($this->choices['off']) ? $this->choices['off'] : $i18n['off'];
     $this->json['choices']['round'] = isset($this->choices['round']) ? $this->choices['round'] : false;
 }
开发者ID:andrezrv,项目名称:kirki,代码行数:9,代码来源:class-kirki-controls-switch-control.php

示例5: to_json

 public function to_json()
 {
     parent::to_json();
     $i18n = Kirki_Toolkit::i18n();
     $this->choices = empty($this->choices) || !is_array($this->choices) ? array() : $this->choices;
     $this->choices['on'] = isset($this->choices['on']) ? $this->choices['on'] : $i18n['on'];
     $this->choices['off'] = isset($this->choices['off']) ? $this->choices['off'] : $i18n['off'];
     $this->json['id'] = $this->id;
     $this->json['value'] = $this->value();
     $this->json['choices'] = $this->choices;
     $this->json['link'] = $this->get_link();
 }
开发者ID:apurbajnu,项目名称:kirki,代码行数:12,代码来源:class-kirki-controls-switch-control.php

示例6: to_json

 public function to_json()
 {
     parent::to_json();
     $fields = $this->fields;
     $i18n = Kirki_Toolkit::i18n();
     $default_image_button_labels = array('default' => $i18n['add-image'], 'remove' => $i18n['remove'], 'change' => $i18n['change-image'], 'placeholder' => $i18n['no-image-selected']);
     foreach ($fields as $key => $field) {
         if ($field['type'] != 'image') {
             continue;
         }
         $fields[$key]['buttonLabels'] = $default_image_button_labels;
     }
     $this->json['fields'] = $fields;
 }
开发者ID:sayedwp,项目名称:kirki,代码行数:14,代码来源:class-kirki-controls-repeater-control.php

示例7: render_content

    /**
     * Render the control's content.
     */
    protected function render_content()
    {
        ?>
		<?php 
        $i18n = Kirki_Toolkit::i18n();
        ?>
		<label for="toggle_<?php 
        echo $this->id;
        ?>
">
			<span class="customize-control-title">
				<?php 
        echo esc_attr($this->label);
        ?>
				<?php 
        if (!empty($this->description)) {
            ?>
					<?php 
            // The description has already been sanitized in the Fields class, no need to re-sanitize it.
            ?>
					<span class="description customize-control-description"><?php 
            echo $this->description;
            ?>
</span>
				<?php 
        }
        ?>
			</span>
		</label>
		<input name="toggle_<?php 
        echo $this->id;
        ?>
" id="toggle_<?php 
        echo $this->id;
        ?>
" type="checkbox" value="<?php 
        echo esc_attr($this->value());
        ?>
" <?php 
        $this->link();
        checked($this->value());
        ?>
 />
		<script>jQuery(document).ready(function($){$('[id="toggle_<?php 
        echo $this->id;
        ?>
"]').checkbox({toggle:true});});</script>
		<?php 
    }
开发者ID:wpmu,项目名称:maera,代码行数:52,代码来源:class-kirki-controls-toggle-control.php

示例8: to_json

 public function to_json()
 {
     parent::to_json();
     if (isset($this->default)) {
         $this->json['default'] = $this->default;
     } else {
         $this->json['default'] = $this->setting->default;
     }
     $this->json['js_vars'] = $this->js_vars;
     $this->json['output'] = $this->output;
     $this->json['value'] = $this->value();
     $this->json['choices'] = $this->choices;
     $this->json['link'] = $this->get_link();
     $this->json['help'] = $this->help;
     $this->json['id'] = $this->id;
     $this->json['i18n'] = Kirki_Toolkit::i18n();
 }
开发者ID:andrezrv,项目名称:kirki,代码行数:17,代码来源:class-kirki-customize-control.php

示例9: to_json

 public function to_json()
 {
     parent::to_json();
     $this->json['l10n'] = Kirki_Toolkit::i18n();
     $this->json['choices'] = array();
     if (is_array($this->choices)) {
         foreach ($this->choices as $choice => $value) {
             if (true === $value) {
                 $this->json['choices'][$choice] = true;
             }
         }
     }
     if (is_array($this->json['default'])) {
         foreach ($this->json['default'] as $key => $value) {
             if (isset($this->json['choices'][$key]) && !isset($this->json['value'][$key])) {
                 $this->json['value'][$key] = $value;
             }
         }
     }
 }
开发者ID:quintenm,项目名称:maresthema-2016,代码行数:20,代码来源:class-kirki-controls-spacing-control.php

示例10: render_content

    /**
     * Render the control's content.
     */
    protected function render_content()
    {
        ?>
		<?php 
        $i18n = Kirki_Toolkit::i18n();
        ?>
		<label for="switch_<?php 
        echo $this->id;
        ?>
">
			<span class="customize-control-title">
				<?php 
        echo esc_attr($this->label);
        ?>
				<?php 
        if (!empty($this->description)) {
            ?>
					<?php 
            // The description has already been sanitized in the Fields class, no need to re-sanitize it.
            ?>
					<span class="description customize-control-description"><?php 
            echo $this->description;
            ?>
</span>
				<?php 
        }
        ?>
			</span>
		</label>
		<input name="switch_<?php 
        echo $this->id;
        ?>
" id="switch_<?php 
        echo $this->id;
        ?>
" type="checkbox" value="<?php 
        echo esc_attr($this->value());
        ?>
" <?php 
        $this->link();
        ?>
 <?php 
        if ('1' == $this->value()) {
            echo 'checked';
        }
        ?>
 />
		<script>
		jQuery(document).ready(function($){
			$('[id="switch_<?php 
        echo $this->id;
        ?>
"]').checkbox({
				toggle:true,
				labels:{
					on:"<?php 
        echo !empty($this->choices) && isset($this->choices['on']) ? $this->choices['on'] : $i18n['ON'];
        ?>
",
					off:"<?php 
        echo !empty($this->choices) && isset($this->choices['off']) ? $this->choices['off'] : $i18n['OFF'];
        ?>
"
				}
			});
		});
		</script>
		<?php 
        if ('0' == $this->value()) {
            ?>
			<script>jQuery(document).ready(function($){$('#customize-control-<?php 
            echo $this->id;
            ?>
 .fs-checkbox').removeClass('fs-checkbox-checked');});</script>
		<?php 
        }
        ?>
		<?php 
    }
开发者ID:yarwalker,项目名称:ecobyt,代码行数:82,代码来源:class-kirki-controls-switch-control.php

示例11: get_standard_fonts

 /**
  * Return an array of standard websafe fonts.
  *
  * @return array    Standard websafe fonts.
  */
 public function get_standard_fonts()
 {
     $i18n = Kirki_Toolkit::i18n();
     if (null == $this->standard_fonts) {
         $this->standard_fonts = apply_filters('kirki/fonts/standard_fonts', array('serif' => array('label' => $i18n['serif'], 'stack' => 'Georgia,Times,"Times New Roman",serif'), 'sans-serif' => array('label' => $i18n['sans-serif'], 'stack' => 'Helvetica,Arial,sans-serif'), 'monospace' => array('label' => $i18n['monospace'], 'stack' => 'Monaco,"Lucida Sans Typewriter","Lucida Typewriter","Courier New",Courier,monospace')));
     }
     return $this->standard_fonts;
 }
开发者ID:de190909,项目名称:WPTest,代码行数:13,代码来源:class-kirki-fonts-font-registry.php

示例12: background_choices

 /**
  * The background choices.
  * @return array<string,array>
  */
 public static function background_choices()
 {
     $i18n = Kirki_Toolkit::i18n();
     return array('repeat' => array('no-repeat' => $i18n['no-repeat'], 'repeat' => $i18n['repeat-all'], 'repeat-x' => $i18n['repeat-x'], 'repeat-y' => $i18n['repeat-y'], 'inherit' => $i18n['inherit']), 'size' => array('inherit' => $i18n['inherit'], 'cover' => $i18n['cover'], 'contain' => $i18n['contain']), 'attach' => array('inherit' => $i18n['inherit'], 'fixed' => $i18n['fixed'], 'scroll' => $i18n['scroll']), 'position' => array('left-top' => $i18n['left-top'], 'left-center' => $i18n['left-center'], 'left-bottom' => $i18n['left-bottom'], 'right-top' => $i18n['right-top'], 'right-center' => $i18n['right-center'], 'right-bottom' => $i18n['right-bottom'], 'center-top' => $i18n['center-top'], 'center-center' => $i18n['center-center'], 'center-bottom' => $i18n['center-bottom']));
 }
开发者ID:andrezrv,项目名称:kirki,代码行数:9,代码来源:class-kirki-explode-background-field.php

示例13: test_i18n

 function test_i18n()
 {
     $this->assertTrue(is_array(Kirki_Toolkit::i18n()));
 }
开发者ID:1bigidea,项目名称:kirki,代码行数:4,代码来源:test-kirki-toolkit.php


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