当前位置: 首页>>代码示例>>PHP>>正文


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怎么用?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);
}
开发者ID:estrategasdigitales,项目名称:dictobas,代码行数:24,代码来源:contact-form.php

示例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;
}
开发者ID:par-orillonsoft,项目名称:elearning-wordpress,代码行数:43,代码来源:controller.php


注:本文中的wpcf7_get_contact_form_by_old_id函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。