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


PHP WPCF7_ContactForm::get_properties方法代碼示例

本文整理匯總了PHP中WPCF7_ContactForm::get_properties方法的典型用法代碼示例。如果您正苦於以下問題:PHP WPCF7_ContactForm::get_properties方法的具體用法?PHP WPCF7_ContactForm::get_properties怎麽用?PHP WPCF7_ContactForm::get_properties使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在WPCF7_ContactForm的用法示例。


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

示例1: wpcf7_get_contact_form_default_pack

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;
}
開發者ID:pyropictures,項目名稱:wordpress-plugins,代碼行數:31,代碼來源:classes.php

示例2: wpcf7_get_contact_form_default_pack

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;
}
開發者ID:sydneyDAD,項目名稱:cardguys.com,代碼行數:25,代碼來源:classes.php


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