本文整理汇总了PHP中wpcf7_load_textdomain函数的典型用法代码示例。如果您正苦于以下问题:PHP wpcf7_load_textdomain函数的具体用法?PHP wpcf7_load_textdomain怎么用?PHP wpcf7_load_textdomain使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了wpcf7_load_textdomain函数的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: get_template
public static function get_template($args = '')
{
global $l10n;
$defaults = array('locale' => null, 'title' => '');
$args = wp_parse_args($args, $defaults);
$locale = $args['locale'];
$title = $args['title'];
if ($locale) {
$mo_orig = $l10n['contact-form-7'];
wpcf7_load_textdomain($locale);
}
self::$current = $contact_form = new self();
$contact_form->title = $title ? $title : __('Untitled', 'contact-form-7');
$contact_form->locale = $locale ? $locale : get_locale();
$properties = $contact_form->get_properties();
foreach ($properties as $key => $value) {
$properties[$key] = WPCF7_ContactFormTemplate::get_default($key);
}
$contact_form->properties = $properties;
$contact_form = apply_filters('wpcf7_contact_form_default_pack', $contact_form, $args);
if (isset($mo_orig)) {
$l10n['contact-form-7'] = $mo_orig;
}
return $contact_form;
}
开发者ID:estrategasdigitales,项目名称:dictobas,代码行数:25,代码来源:contact-form.php
示例2: wpcf7_install
function wpcf7_install()
{
if ($opt = get_option('wpcf7')) {
return;
}
wpcf7_load_textdomain();
wpcf7_register_post_types();
wpcf7_upgrade();
if (get_posts(array('post_type' => 'wpcf7_contact_form'))) {
return;
}
$contact_form = WPCF7_ContactForm::get_template(array('title' => sprintf(__('Contact form %d', 'contact-form-7'), 1)));
$contact_form->save();
}
开发者ID:aim-web-projects,项目名称:kobe-chuoh,代码行数:14,代码来源:settings.php
示例3: generate_default_package
public static function generate_default_package($args = '')
{
global $l10n;
$defaults = array('locale' => null, 'title' => '');
$args = wp_parse_args($args, $defaults);
$locale = $args['locale'];
$title = $args['title'];
if ($locale) {
$mo_orig = $l10n['contact-form-7'];
wpcf7_load_textdomain($locale);
}
$contact_form = new self();
$contact_form->initial = true;
$contact_form->title = $title ? $title : __('Untitled', 'contact-form-7');
$contact_form->locale = $locale ? $locale : get_locale();
$props = $contact_form->get_properties();
foreach ($props as $prop => $value) {
$contact_form->{$prop} = wpcf7_get_default_template($prop);
}
$contact_form = apply_filters('wpcf7_contact_form_default_pack', $contact_form, $args);
if (isset($mo_orig)) {
$l10n['contact-form-7'] = $mo_orig;
}
return $contact_form;
}
开发者ID:byronmisiva,项目名称:msv-dev,代码行数:25,代码来源:classes.php
示例4: wpcf7_install
function wpcf7_install()
{
if ($opt = get_option('wpcf7')) {
return;
}
wpcf7_load_textdomain();
wpcf7_register_post_types();
wpcf7_upgrade();
if (get_posts(array('post_type' => 'wpcf7_contact_form'))) {
return;
}
$contact_form = WPCF7_ContactForm::get_template(array('title' => sprintf(__('Contact form %d', 'contact-form-7'), 1)));
$contact_form->save();
WPCF7::update_option('bulk_validate', array('timestamp' => current_time('timestamp'), 'version' => WPCF7_VERSION, 'count_valid' => 1, 'count_invalid' => 0));
}
开发者ID:jesusmarket,项目名称:jesusmarket,代码行数:15,代码来源:settings.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_load_textdomain函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论