コード例 #1
0
ファイル: contact-form.php プロジェクト: crazyyy/octagram
 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_get_default_template($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;
 }
コード例 #2
0
function wpcf7_get_contact_form_default_pack($args = '')
{
    global $l10n;
    $defaults = array('locale' => null, 'title' => '');
    $args = wp_parse_args($args, $defaults);
    $locale = $args['locale'];
    $title = $args['title'];
    if ($locale && $locale != get_locale()) {
        $mo_orig = $l10n['wpcf7'];
        unset($l10n['wpcf7']);
        if ('en_US' != $locale) {
            $mofile = wpcf7_plugin_path('languages/wpcf7-' . $locale . '.mo');
            if (!load_textdomain('wpcf7', $mofile)) {
                $l10n['wpcf7'] = $mo_orig;
                unset($mo_orig);
            }
        }
    }
    $contact_form = new WPCF7_ContactForm();
    $contact_form->initial = true;
    $contact_form->title = $title ? $title : __('Untitled', 'wpcf7');
    $props = $contact_form->get_properties();
    foreach ($props as $prop => $value) {
        $contact_form->{$prop} = wpcf7_get_default_template($prop);
    }
    if (isset($mo_orig)) {
        $l10n['wpcf7'] = $mo_orig;
    }
    $contact_form = apply_filters_ref_array('wpcf7_contact_form_default_pack', array(&$contact_form, $args));
    return $contact_form;
}
コード例 #3
0
ファイル: classes.php プロジェクト: xuandungpy/vuong
function wpcf7_get_contact_form_default_pack($args = '')
{
    global $l10n;
    $defaults = array('locale' => null, 'title' => '');
    $args = wp_parse_args($args, $defaults);
    $locale = $args['locale'];
    $title = $args['title'];
    if ($locale && $locale != get_locale()) {
        $mo_orig = $l10n['wpcf7'];
        unset($l10n['wpcf7']);
        if ('en_US' != $locale) {
            $mofile = wpcf7_plugin_path('languages/wpcf7-' . $locale . '.mo');
            if (!load_textdomain('wpcf7', $mofile)) {
                $l10n['wpcf7'] = $mo_orig;
                unset($mo_orig);
            }
        }
    }
    $contact_form = new WPCF7_ContactForm();
    $contact_form->initial = true;
    $contact_form->title = $title ? $title : __('Untitled', 'wpcf7');
    $contact_form->form = wpcf7_get_default_template('form');
    $contact_form->mail = wpcf7_get_default_template('mail');
    $contact_form->mail_2 = wpcf7_get_default_template('mail_2');
    $contact_form->messages = wpcf7_get_default_template('messages');
    $contact_form->additional_settings = wpcf7_get_default_template('additional_settings');
    if (isset($mo_orig)) {
        $l10n['wpcf7'] = $mo_orig;
    }
    $contact_form = apply_filters_ref_array('wpcf7_contact_form_default_pack', array(&$contact_form, $args));
    return $contact_form;
}
コード例 #4
0
ファイル: classes.php プロジェクト: sydneyDAD/cardguys.com
function wpcf7_get_contact_form_default_pack($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 WPCF7_ContactForm();
    $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_ref_array('wpcf7_contact_form_default_pack', array(&$contact_form, $args));
    if (isset($mo_orig)) {
        $l10n['contact-form-7'] = $mo_orig;
    }
    return $contact_form;
}