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; }
function _s_wpcf7_default_template($template, $prop) { if ('form' == $prop) { $template = _s_form(); } elseif ('mail' == $prop) { $template = _s_mail(); } elseif ('mail_2' == $prop) { $template = WPCF7_ContactFormTemplate::mail_2(); } elseif ('messages' == $prop) { $template = WPCF7_ContactFormTemplate::messages(); } else { $template = null; } return $template; }