本文整理汇总了PHP中wpcf7_get_contact_form_by_old_id函数的典型用法代码示例。如果您正苦于以下问题:PHP wpcf7_get_contact_form_by_old_id函数的具体用法?PHP wpcf7_get_contact_form_by_old_id怎么用?PHP wpcf7_get_contact_form_by_old_id使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了wpcf7_get_contact_form_by_old_id函数的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: wpcf7_contact_form_tag_func
function wpcf7_contact_form_tag_func($atts, $content = null, $code = '')
{
if (is_feed()) {
return '[contact-form-7]';
}
if ('contact-form-7' == $code) {
$atts = shortcode_atts(array('id' => 0, 'title' => '', 'html_id' => '', 'html_name' => '', 'html_class' => '', 'output' => 'form'), $atts);
$id = (int) $atts['id'];
$title = trim($atts['title']);
if (!($contact_form = wpcf7_contact_form($id))) {
$contact_form = wpcf7_get_contact_form_by_title($title);
}
} else {
if (is_string($atts)) {
$atts = explode(' ', $atts, 2);
}
$id = (int) array_shift($atts);
$contact_form = wpcf7_get_contact_form_by_old_id($id);
}
if (!$contact_form) {
return '[contact-form-7 404 "Not Found"]';
}
return $contact_form->form_html($atts);
}
示例2: wpcf7_contact_form_tag_func
function wpcf7_contact_form_tag_func($atts, $content = null, $code = '')
{
global $wpcf7, $wpcf7_contact_form;
if (is_feed()) {
return '[contact-form-7]';
}
if ('contact-form-7' == $code) {
$atts = shortcode_atts(array('id' => 0, 'title' => ''), $atts);
$id = (int) $atts['id'];
$title = trim($atts['title']);
if (!($wpcf7_contact_form = wpcf7_contact_form($id))) {
$wpcf7_contact_form = wpcf7_get_contact_form_by_title($title);
}
} else {
if (is_string($atts)) {
$atts = explode(' ', $atts, 2);
}
$id = (int) array_shift($atts);
$wpcf7_contact_form = wpcf7_get_contact_form_by_old_id($id);
}
if (!$wpcf7_contact_form) {
return '[contact-form-7 404 "Not Found"]';
}
if ($wpcf7->processing_within) {
// Inside post content or text widget
$wpcf7->unit_count += 1;
$unit_count = $wpcf7->unit_count;
$processing_within = $wpcf7->processing_within;
} else {
// Inside template
if (!isset($wpcf7->global_unit_count)) {
$wpcf7->global_unit_count = 0;
}
$wpcf7->global_unit_count += 1;
$unit_count = 1;
$processing_within = 't' . $wpcf7->global_unit_count;
}
$unit_tag = 'wpcf7-f' . $wpcf7_contact_form->id . '-' . $processing_within . '-o' . $unit_count;
$wpcf7_contact_form->unit_tag = $unit_tag;
$form = $wpcf7_contact_form->form_html();
$wpcf7_contact_form = null;
return $form;
}