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


PHP wpcf7_l10n函数代码示例

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


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

示例1: wpcf7_is_valid_locale

function wpcf7_is_valid_locale($locale)
{
    $l10n = wpcf7_l10n();
    return isset($l10n[$locale]);
}
开发者ID:StefanBonilla,项目名称:CoupSoup,代码行数:5,代码来源:l10n.php

示例2: wpcf7_admin_lang_select_modal

function wpcf7_admin_lang_select_modal()
{
    $available_locales = wpcf7_l10n();
    $default_locale = get_locale();
    if (!isset($available_locales[$default_locale])) {
        $default_locale = 'en_US';
    }
    ?>
<div id="wpcf7-lang-select-modal" class="hidden">
<h4><?php 
    echo esc_html(sprintf(__('Use the default language (%s)', 'wpcf7'), $available_locales[$default_locale]));
    ?>
</h4>
<p><a href="<?php 
    echo esc_url(add_query_arg(array('post' => 'new'), menu_page_url('wpcf7', false)));
    ?>
" class="button" /><?php 
    echo esc_html(__('Add New', 'wpcf7'));
    ?>
</a></p>

<?php 
    unset($available_locales[$default_locale]);
    ?>
<h4><?php 
    echo esc_html(__('Or', 'wpcf7'));
    ?>
</h4>
<form action="" method="get">
<input type="hidden" name="page" value="wpcf7" />
<input type="hidden" name="post" value="new" />
<select name="locale">
<option value="" selected="selected"><?php 
    echo esc_html(__('(select language)', 'wpcf7'));
    ?>
</option>
<?php 
    foreach ($available_locales as $code => $locale) {
        ?>
<option value="<?php 
        echo esc_attr($code);
        ?>
"><?php 
        echo esc_html($locale);
        ?>
</option>
<?php 
    }
    ?>
</select>
<input type="submit" class="button" value="<?php 
    echo esc_attr(__('Add New', 'wpcf7'));
    ?>
" />
</form>
</div>
<?php 
}
开发者ID:Savantos,项目名称:cow-theme,代码行数:58,代码来源:admin.php

示例3: wp_nonce_field

    wp_nonce_field('meta-box-order', 'meta-box-order-nonce', false);
    wp_nonce_field('closedpostboxes', 'closedpostboxesnonce', false);
    ?>
	</div>

</form>

<?php 
}
?>

</div>

<div id="wpcf7-lang-select-modal" class="hidden">
<?php 
$available_locales = wpcf7_l10n();
$default_locale = get_locale();
if (!isset($available_locales[$default_locale])) {
    $default_locale = 'en_US';
}
?>
<h4><?php 
echo esc_html(sprintf(__('Use the default language (%s)', 'wpcf7'), $available_locales[$default_locale]));
?>
</h4>
<p><a href="<?php 
echo wpcf7_admin_url(array('contactform' => 'new'));
?>
" class="button" /><?php 
echo esc_html(__('Add New', 'wpcf7'));
?>
开发者ID:Bencheci,项目名称:blueRavenStudiosProject,代码行数:31,代码来源:edit.php

示例4: wpcf7_admin_add_new_page

function wpcf7_admin_add_new_page()
{
    if ($post = wpcf7_get_current_contact_form()) {
        $post_id = -1;
        require_once WPCF7_PLUGIN_DIR . '/admin/includes/editor.php';
        require_once WPCF7_PLUGIN_DIR . '/admin/edit-contact-form.php';
        return;
    }
    $available_locales = wpcf7_l10n();
    $default_locale = get_locale();
    if (!isset($available_locales[$default_locale])) {
        $default_locale = 'en_US';
    }
    ?>
<div class="wrap">

<h2><?php 
    echo esc_html(__('Add New Contact Form', 'contact-form-7'));
    ?>
</h2>

<?php 
    do_action('wpcf7_admin_notices');
    ?>

<h3><?php 
    echo esc_html(sprintf(__('Use the default language (%s)', 'contact-form-7'), $available_locales[$default_locale]));
    ?>
</h3>
<p><a href="<?php 
    echo esc_url(add_query_arg(array('locale' => $default_locale), menu_page_url('wpcf7-new', false)));
    ?>
" class="button button-primary" /><?php 
    echo esc_html(__('Add New', 'contact-form-7'));
    ?>
</a></p>

<?php 
    unset($available_locales[$default_locale]);
    ?>
<h3><?php 
    echo esc_html(__('Or', 'contact-form-7'));
    ?>
</h3>
<form action="" method="get">
<input type="hidden" name="page" value="wpcf7-new" />
<select name="locale">
<option value="" selected="selected"><?php 
    echo esc_html(__('(select language)', 'contact-form-7'));
    ?>
</option>
<?php 
    foreach ($available_locales as $code => $locale) {
        ?>
<option value="<?php 
        echo esc_attr($code);
        ?>
"><?php 
        echo esc_html($locale);
        ?>
</option>
<?php 
    }
    ?>
</select>
<input type="submit" class="button" value="<?php 
    echo esc_attr(__('Add New', 'contact-form-7'));
    ?>
" />
</form>
</div>
<?php 
}
开发者ID:ArtistryandFunction,项目名称:contact-form-7,代码行数:73,代码来源:admin.php

示例5: load_template

 /**
  * Load selected template and translate.
  * 
  * @uses wpcf7_load_textdomain
  * @since 0.0.1
  */
 function load_template()
 {
     // Check the nonce and if not valid, just die.
     if (!isset($_POST['nonce']) || !wp_verify_nonce($_POST['nonce'], 'cf7s')) {
         die;
     }
     // Get translation if locale is set and exists in the Contact Form 7 l10n
     if (isset($_POST['locale']) && !empty($_POST['locale']) && array_key_exists($_POST['locale'], wpcf7_l10n())) {
         wpcf7_load_textdomain($_POST['locale']);
     }
     // Get translation based on post ID
     if (isset($_POST['post']) && !empty($_POST['post'])) {
         $wpcf7 = wpcf7_contact_form((int) $_POST['post']);
         // current CF7 form
         wpcf7_load_textdomain($wpcf7->locale);
     }
     // Load selected template file
     $templates = $this->cf7s_get_template_list();
     $template = $templates[$_POST['template']];
     require_once $template['path'] . trailingslashit($template['dir']) . $template['index'];
     exit;
 }
开发者ID:pabloe01,项目名称:Rawsonenmovimiento,代码行数:28,代码来源:template.php


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