• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP WPCF7_Submission类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中WPCF7_Submission的典型用法代码示例。如果您正苦于以下问题:PHP WPCF7_Submission类的具体用法?PHP WPCF7_Submission怎么用?PHP WPCF7_Submission使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了WPCF7_Submission类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: save_form

/**
  * [nombre_del_formulario] [Esto ocupo para comparar el nombre del formulario para guardar en la tabla correcta]
  * 
  * [nombre_de_la_tabla] [se concatena con el prefijo seleccionado en la instalacion que por defecto es wp_ + nombre de la tabla a guardar]
  *
  *	[$submited['posted_data']['nombre_campo_form']] [Para jalar datos del formulario lo sacamos de un array $submited['posted_data'] seguido del nombre del campo ingresado en el form ['nombre_campo_form']]
  * 
  * [save_form Guarda en base cualquier formulario enviado por contact form 7]
  * @param  [type] $wpcf7 [variable global de wp que se utiliza para guardar datos en esta funcion]
  * @return [type]        [description]
*/
function save_form($wpcf7)
{
    global $wpdb;
    /*
     Note: since version 3.9 Contact Form 7 has removed $wpcf7->posted_data
     and now we use an API to get the posted data.
    */
    $submission = WPCF7_Submission::get_instance();
    if ($submission) {
        $submited = array();
        $submited['title'] = $wpcf7->title();
        $submited['posted_data'] = $submission->get_posted_data();
    }
    /**
     * Uso de la mayoría de formularios acerca de suscribirse o no
     */
    if ($submited['posted_data']['info'] == 'on') {
        $info = 'Si quiero recibir informacion';
    } else {
        $info = 'No quiero recibir informacion';
    }
    if ($submited['title'] == 'nombre_del_formulario') {
        $wpdb->insert($wpdb->prefix . 'nombre_de_la_tabla', array('nombre' => $submited['posted_data']['your-name'], 'apellido' => $submited['posted_data']['last-name'], 'email' => $submited['posted_data']['email-gana'], 'artista' => $submited['posted_data']['artist-fav'], 'info' => $info, 'fecha' => date('Y-m-d')));
    }
}
开发者ID:SHIFT-EC,项目名称:shift-press,代码行数:36,代码来源:save-contact-form.php


示例2: notification_email

 /**
  * Set the notification email when sending an email.
  *
  * @since WP Job Manager - Contact Listing 1.0.0
  *
  * @return string The email to notify.
  */
 public function notification_email($components, $cf7, $three = null)
 {
     $submission = WPCF7_Submission::get_instance();
     $unit_tag = $submission->get_meta('unit_tag');
     if (!preg_match('/^wpcf7-f(\\d+)-p(\\d+)-o(\\d+)$/', $unit_tag, $matches)) {
         return $components;
     }
     $post_id = (int) $matches[2];
     $object = get_post($post_id);
     // Prevent issues when the form is not submitted via a listing/resume page
     if (!isset($this->forms[$object->post_type])) {
         return $components;
     }
     if (!array_search($cf7->id(), $this->forms[$object->post_type])) {
         return $components;
     }
     // Bail if this is the second mail
     if (isset($three) && 'mail_2' == $three->name()) {
         return $components;
     }
     $recipient = $object->_application ? $object->_application : $object->_candidate_email;
     //if we couldn't find the email by now, get it from the listing owner/author
     if (empty($recipient)) {
         //just get the email of the listing author
         $owner_ID = $object->post_author;
         //retrieve the owner user data to get the email
         $owner_info = get_userdata($owner_ID);
         if (false !== $owner_info) {
             $recipient = $owner_info->user_email;
         }
     }
     $components['recipient'] = $recipient;
     return $components;
 }
开发者ID:durichitayat,项目名称:befolio-wp,代码行数:41,代码来源:cf7.php


示例3: wpcf7_do_before_send

function wpcf7_do_before_send($wpcf7)
{
    $submission = WPCF7_Submission::get_instance();
    $data = $submission->get_posted_data();
    $_SESSION['posted_data'] = $data;
    return true;
}
开发者ID:rodsilver83,项目名称:victoria,代码行数:7,代码来源:functions.php


示例4: beforeSendEmail

 function beforeSendEmail($cf7)
 {
     $submission = WPCF7_Submission::get_instance();
     if ($submission) {
         $data = $submission->get_posted_data();
         $dataArr = array_merge($data, array('created_date' => current_time('mysql')));
         add_post_meta($data['_wpcf7'], 'cf7-adb-data', $dataArr);
     }
 }
开发者ID:DjKarui,项目名称:powerhouse,代码行数:9,代码来源:cf7_adb.class.php


示例5: ip_wpcf7_mail_sent

function ip_wpcf7_mail_sent($wpcf7){
		$submission = WPCF7_Submission::get_instance();
			if ( $submission ) {
				$formdata = $submission->get_posted_data();
				$email = $formdata['your-email'];
				$first_name = $formdata['your-first-name'];
				$last_name = $formdata['your-last-name'];
				$tel = $formdata['your-tel'];
				$plan = $formdata['your-plan'];
			}
			$time = $today = date("F j, Y, g:i a");
        // Open Agent:
        $curl = curl_init();
        curl_setopt_array($curl, array(
                CURLOPT_RETURNTRANSFER => 1,
                CURLOPT_URL => 'http://ag.panda8.co/api?action=createAgentPph&creditAgent=1000&credit=100&currency=USD&masterId=DEMVI&numOfUser=1&email='.$email.'&key=BBBAB3NzaC1yc2EAAAABJQAAAIEAhCdDMhGHdaw1uj9MH2xCB4jktwIgm4Al7S8rxvovMJBAuFKkMDd0vW5gpurUAB0PEPkxh6QFoBNazvio7Q03f90tSP9qpJMGwZid9hJEElplW8p43D3DdxXykLays2M8V2viYGLbiXvAbOECzwD4IaviOpylX0PaFznSR4ssXd0Int',
                CURLOPT_USERAGENT => 'PPH186',
                CURLOPT_FOLLOWLOCATION => 1,
        ));
		$resp = curl_exec($curl);
        $variables = json_decode($resp,true);
        $agent = strtoupper($variables['agentId']);
        $password = $variables['password'];
        curl_close($curl); 
        // Send Info to bot
		$text = urlencode("-- Sign up -- \n".$time."\n"."First Name: ".$first_name."\n"."Last Name: ".$last_name."\n"."Email: ".$email."\n"."Tel: ".$tel."\n"."Plan: ".$plan."\nAgent ID: ".$agent);
        $curl = curl_init();
        // Set some options - we are passing in a useragent too here
        curl_setopt_array($curl, array(
                CURLOPT_RETURNTRANSFER => 1,
                CURLOPT_URL => 'http://pph186.com/bot.php?key=b6fbc59dea1f5c41551f895886edbee5&msg='.$text.'&agent_id=sa',
                CURLOPT_USERAGENT => 'PPH186'
        ));
		// Send the request & save response to $resp
        $resp = curl_exec($curl);
        // Close request to clear up some resources
        curl_close($curl);
        $params = array(
   					"first_name" => $first_name,
 					"last_name" => $last_name,
  					"phone_mobile" => $tel,
  					"email1" => $email,
  					"account_name" => $agent,
  					"account_description" => $plan,
  					"campaign_id" => "c78e72d1-bfaa-b060-be8e-56cb258c33e6",
  					"assigned_user_id" => "1",
		);
 		echo httpPost("http://crm.pph186.com/index.php?entryPoint=WebToLeadCapture",$params);
 		$_SESSION["first_name"] = $first_name;
 		$_SESSION["last_name"] = $last_name;
 		$_SESSION["account_name"] = $agent;

       
}
开发者ID:kyborg,项目名称:OneBet-Skin,代码行数:54,代码来源:contact_fỏm.php


示例6: action_wpcf7_mail_sent

function action_wpcf7_mail_sent($contact_form)
{
    $submission = WPCF7_Submission::get_instance();
    if ($submission) {
        $posted_data = $submission->get_posted_data();
        $to = $posted_data['your-email'];
        $subject = 'Thank you for your interest in GVCO';
        $body = 'Thank you for your interest in the future of the Great Valley Community Organization. A member of our Building Connections Campaign Committee will be in touch with you shortly. In the meantime, be sure to follow us on social media for the latest news and updates.';
        wp_mail($to, $subject, $body);
    }
}
开发者ID:aaronfrey,项目名称:PepperLillie-GVCO,代码行数:11,代码来源:functions.php


示例7: tcb_mail_sent_function

function tcb_mail_sent_function($contact_form)
{
    $title = $contact_form->title;
    $submission = WPCF7_Submission::get_instance();
    if ($submission) {
        $posted_data = $submission->get_posted_data();
    }
    if ('referralForm' == $title) {
        $current_user = wp_get_current_user();
        for ($i = 1; $i <= 3; $i++) {
            add_filter('wp_mail_content_type', 'set_html_content_type');
            add_filter('wp_mail_from', 'tcb_website_email');
            add_filter('wp_mail_from_name', 'tcb_website_name');
            if (!$posted_data["email_" . $i]) {
                continue;
            }
            ob_start();
            include TCP_TEMPLATE_PATH . "referral_email.php";
            $message = ob_get_contents();
            ob_end_clean();
            wp_mail($posted_data["email_" . $i], 'e-Voucher from ' . $current_user->user_firstname . " " . $current_user->user_lastname, $message);
            remove_filter('wp_mail_content_type', 'set_html_content_type');
            remove_filter('wp_mail_from_name', 'tcb_website_name');
            remove_filter('wp_mail_from', 'tcb_website_email');
        }
    }
}
开发者ID:ntnvu,项目名称:tcb_online,代码行数:27,代码来源:functions.php


示例8: wpcf7_flamingo_submit

function wpcf7_flamingo_submit($contactform, $result)
{
    if (!class_exists('Flamingo_Contact') || !class_exists('Flamingo_Inbound_Message')) {
        return;
    }
    if ($contactform->in_demo_mode() || $contactform->is_true('do_not_store')) {
        return;
    }
    $cases = (array) apply_filters('wpcf7_flamingo_submit_if', array('spam', 'mail_sent', 'mail_failed'));
    if (empty($result['status']) || !in_array($result['status'], $cases)) {
        return;
    }
    $submission = WPCF7_Submission::get_instance();
    if (!$submission || !($posted_data = $submission->get_posted_data())) {
        return;
    }
    $fields_senseless = $contactform->form_scan_shortcode(array('type' => array('captchar', 'quiz', 'acceptance')));
    $exclude_names = array();
    foreach ($fields_senseless as $tag) {
        $exclude_names[] = $tag['name'];
    }
    $exclude_names[] = 'g-recaptcha-response';
    foreach ($posted_data as $key => $value) {
        if ('_' == substr($key, 0, 1) || in_array($key, $exclude_names)) {
            unset($posted_data[$key]);
        }
    }
    $email = wpcf7_flamingo_get_value('email', $contactform);
    $name = wpcf7_flamingo_get_value('name', $contactform);
    $subject = wpcf7_flamingo_get_value('subject', $contactform);
    $meta = array();
    $special_mail_tags = array('remote_ip', 'user_agent', 'url', 'date', 'time', 'post_id', 'post_name', 'post_title', 'post_url', 'post_author', 'post_author_email');
    foreach ($special_mail_tags as $smt) {
        $meta[$smt] = apply_filters('wpcf7_special_mail_tags', '', '_' . $smt, false);
    }
    $akismet = isset($submission->akismet) ? (array) $submission->akismet : null;
    if ('mail_sent' == $result['status']) {
        Flamingo_Contact::add(array('email' => $email, 'name' => $name));
    }
    $channel_id = wpcf7_flamingo_add_channel($contactform->name(), $contactform->title());
    if ($channel_id) {
        $channel = get_term($channel_id, Flamingo_Inbound_Message::channel_taxonomy);
        if (!$channel || is_wp_error($channel)) {
            $channel = 'contact-form-7';
        } else {
            $channel = $channel->slug;
        }
    } else {
        $channel = 'contact-form-7';
    }
    $args = array('channel' => $channel, 'subject' => $subject, 'from' => trim(sprintf('%s <%s>', $name, $email)), 'from_name' => $name, 'from_email' => $email, 'fields' => $posted_data, 'meta' => $meta, 'akismet' => $akismet, 'spam' => 'spam' == $result['status']);
    Flamingo_Inbound_Message::add($args);
}
开发者ID:idies,项目名称:escience-2016-wp,代码行数:53,代码来源:flamingo.php


示例9: beforeSendEmail

 function beforeSendEmail($cf7)
 {
     $submission = WPCF7_Submission::get_instance();
     if ($submission) {
         $data = $submission->get_posted_data();
         $dataArr = array_merge($data, array('created_date' => current_time('mysql')));
         add_post_meta($data['_wpcf7'], 'cf7-adb-data', $dataArr);
         $unread_messages = get_post_meta($data['_wpcf7'], 'cf7-adb-data-unread', true);
         update_post_meta($data['_wpcf7'], 'cf7-adb-data-unread', intval($unread_messages) + 1);
         //status 1= show notification | 2 = hide notofication
         update_option('cf7-adb-data-show-notif', 1);
     }
 }
开发者ID:etuannv,项目名称:xkld,代码行数:13,代码来源:cf7_adb.class.php


示例10: your_wpcf7_mail_sent_function

function your_wpcf7_mail_sent_function($contact_form)
{
    $title = $contact_form->title;
    $submission = WPCF7_Submission::get_instance();
    if ($submission) {
        $posted_data = $submission->get_posted_data();
    }
    if ('Send a Gift 2' == $title) {
        $usergiftBudget = $posted_data['giftBudget'];
        setcookie("CustomBudget", $usergiftBudget, strtotime('+10 minutes'), "/");
        // sleep(10);
    }
}
开发者ID:JaneJieYing,项目名称:ookiddo_v1,代码行数:13,代码来源:ok_cf7budget_to_cart.php


示例11: create_user_from_registration

function create_user_from_registration($cfdata)
{
    if (!isset($cfdata->posted_data) && class_exists('WPCF7_Submission')) {
        // Contact Form 7 version 3.9 removed $cfdata->posted_data and now
        // we have to retrieve it from an API
        $submission = WPCF7_Submission::get_instance();
        if ($submission) {
            $formdata = $submission->get_posted_data();
        }
    } elseif (isset($cfdata->posted_data)) {
        // For pre-3.9 versions of Contact Form 7
        $formdata = $cfdata->posted_data;
    } else {
        // We can't retrieve the form data
        return $cfdata;
    }
    // Check this is the user registration form
    switch ($cfdata->id()) {
        case 268:
            $ruolo = "hw2_client";
            break;
        case 716:
            $ruolo = "hw2_contributor";
            break;
        case 733:
            $ruolo = "hw2_partner";
            break;
        default:
            $ruolo = "subscriber";
            break;
    }
    $password = wp_generate_password(12, false);
    $email = $formdata['Email'];
    $first = $formdata['First'];
    $last = $formdata['Last'];
    // Construct a username from the user's name
    $username = strtolower(str_replace(' ', '', $first));
    if (!email_exists($email)) {
        // Find an unused username
        $username_tocheck = $username;
        $i = 1;
        while (username_exists($username_tocheck)) {
            $username_tocheck = $username . $i++;
        }
        $username = $username_tocheck;
        // Create the user
        $userdata = array('user_login' => $username, 'user_pass' => $password, 'user_email' => $email, 'nickname' => $first, 'display_name' => $first, 'first_name' => $first, 'last_name' => $last, 'role' => $ruolo);
        $user_id = wp_insert_user($userdata);
    }
    return $cfdata;
}
开发者ID:hyperweb2,项目名称:contract-form,代码行数:51,代码来源:cf7.php


示例12: tcb_custom_mail_components

function tcb_custom_mail_components($WPCF7_ContactForm)
{
    $title = $WPCF7_ContactForm->title;
    if ('referralForm' == $title) {
        $submission = WPCF7_Submission::get_instance();
        if ($submission) {
            $posted_data = $submission->get_posted_data();
        }
        $mail = $WPCF7_ContactForm->prop('mail');
        ob_start();
        include TCP_TEMPLATE_PATH . "referral_email_to_admin.php";
        $message = ob_get_contents();
        ob_end_clean();
        $mail['body'] = str_replace('[referral_content]', $message, $mail['body']);
        $WPCF7_ContactForm->set_properties(array('mail' => $mail));
    }
    if ('Warranty form' == $title) {
        $submission = WPCF7_Submission::get_instance();
        if ($submission) {
            $posted_data = $submission->get_posted_data();
        }
        $password = $posted_data["nric_fin"];
        $user_email = $posted_data["email"];
        $mail = $WPCF7_ContactForm->prop('mail_2');
        $user_id = username_exists($user_email);
        if (!$user_id and email_exists($user_email) == false) {
            $userdata = array('user_login' => $user_email, 'user_pass' => $password, 'user_email' => $user_email, 'first_name' => $posted_data["surname"], 'last_name' => $posted_data["given_name"], 'display_name' => $posted_data["given_name"]);
            $user_id = wp_insert_user($userdata);
            //update extra info for customer
            update_user_meta($user_id, 'salutation', $posted_data['title'], get_the_author_meta('salutation', $user_id));
            update_user_meta($user_id, 'nric_fin_user', $posted_data['nric_fin'], get_the_author_meta('nric_fin', $user_id));
            update_user_meta($user_id, 'dob', $posted_data['date_of_birth'], get_the_author_meta('dob', $user_id));
            update_user_meta($user_id, 'address_user', $posted_data['block'] . " " . $posted_data['street_name'], get_the_author_meta('address', $user_id));
            update_user_meta($user_id, 'postal_code', $posted_data['postal_code'], get_the_author_meta('postal_code', $user_id));
            update_user_meta($user_id, 'phone', $posted_data['contact'], get_the_author_meta('phone', $user_id));
            $message = "<div>Username: " . $user_email . "</div><div>Password: " . $password . "</div>";
            $mail['body'] = str_replace('[user_pass]', $message, $mail['body']);
            $WPCF7_ContactForm->set_properties(array('mail_2' => $mail));
            global $wpdb;
            $sql = "INSERT INTO {$wpdb->wrranty_db_table} (invoiceId, address, contact, date_of_installation, wrranty_date, user_id) ";
            $sql .= " VALUES ('" . $posted_data["invoice_no"] . "', '" . $posted_data['block'] . " " . $posted_data['street_name'] . "' , '" . $posted_data['contact'] . "' , '" . $posted_data["date_of_installation"] . "', '', '" . $user_id . "') ";
            $wpdb->query($sql);
        } else {
            //            $WPCF7_ContactForm->skip_mail = true;
            $mail['body'] = "";
            $WPCF7_ContactForm->set_properties(array('mail_2' => $mail));
        }
    }
}
开发者ID:ntnvu,项目名称:tcb_online,代码行数:49,代码来源:functions.php


示例13: contact_form_7

 public function contact_form_7($cf7)
 {
     $forms = $this->get_forms('rdcf7_integrations');
     foreach ($forms as $form) {
         $form_id = get_post_meta($form->ID, 'form_id', true);
         if ($form_id == $cf7->id()) {
             $submission = WPCF7_Submission::get_instance();
             if ($submission) {
                 $this->form_data = $submission->get_posted_data();
             }
             $this->generate_static_fields($form->ID, 'Plugin Contact Form 7');
             $this->conversion($this->form_data);
         }
     }
 }
开发者ID:ResultadosDigitais,项目名称:rdstation-wp,代码行数:15,代码来源:lead-conversion.php


示例14: create_user_from_registration

function create_user_from_registration($cfdata)
{
    if (!isset($cfdata->posted_data) && class_exists('WPCF7_Submission')) {
        // Contact Form 7 version 3.9 removed $cfdata->posted_data and now
        // we have to retrieve it from an API
        $submission = WPCF7_Submission::get_instance();
        if ($submission) {
            $formdata = $submission->get_posted_data();
        }
    } elseif (isset($cfdata->posted_data)) {
        // For pre-3.9 versions of Contact Form 7
        $formdata = $cfdata->posted_data;
    } else {
        // We can't retrieve the form data
        return $cfdata;
    }
    // Check this is the user registration form
    if ($cfdata->title() == 'Your Registration Form Title') {
        $password = wp_generate_password(12, false);
        $email = $formdata['form-email-field'];
        $name = $formdata['form-name-field'];
        // Construct a username from the user's name
        $username = strtolower(str_replace(' ', '', $name));
        $name_parts = explode(' ', $name);
        if (!email_exists($email)) {
            // Find an unused username
            $username_tocheck = $username;
            $i = 1;
            while (username_exists($username_tocheck)) {
                $username_tocheck = $username . $i++;
            }
            $username = $username_tocheck;
            // Create the user
            $userdata = array('user_login' => $username, 'user_pass' => $password, 'user_email' => $email, 'nickname' => reset($name_parts), 'display_name' => $name, 'first_name' => reset($name_parts), 'last_name' => end($name_parts), 'role' => 'subscriber');
            $user_id = wp_insert_user($userdata);
            if (!is_wp_error($user_id)) {
                // Email login details to user
                $blogname = wp_specialchars_decode(get_option('blogname'), ENT_QUOTES);
                $message = "Welcome! Your login details are as follows:" . "\r\n";
                $message .= sprintf(__('Username: %s'), $username) . "\r\n";
                $message .= sprintf(__('Password: %s'), $password) . "\r\n";
                $message .= wp_login_url() . "\r\n";
                wp_mail($email, sprintf(__('[%s] Your username and password'), $blogname), $message);
            }
        }
    }
    return $cfdata;
}
开发者ID:srinivasulurao,项目名称:transcharity,代码行数:48,代码来源:functions.php


示例15: insert_question

function insert_question($question_form)
{
    $submission = WPCF7_Submission::get_instance();
    if ($submission) {
        $posted_data = $submission->get_posted_data();
    }
    if ($posted_data['checktype'] == 'question') {
        $taxonomy = 'department';
        $term = get_term_by('slug', $posted_data['post_name'], $taxonomy);
        $term_id = $term->term_id;
        // Создание пользователя - автора вопроса
        if ($posted_data['your-email']) {
            $user_email = $posted_data['your-email'];
            $user_name = $posted_data['your-name'];
            $user_id = email_exists($user_email);
            if (!$user_id and email_exists($user_email) == false) {
                $random_password = wp_generate_password($length = 12, $include_standard_special_chars = false);
                $user_id = wp_create_user($user_name, $random_password, $user_email);
            }
        }
        $question = $posted_data['your-question'];
        // Добавление вопроса
        $question_id = wp_insert_post(array('post_content' => '', 'post_type' => 'question', 'post_title' => $user_name, 'post_excerpt' => $question, 'post_author' => $user_id));
        wp_set_object_terms($question_id, $term_id, $taxonomy);
        // Уведомление специалисту
        $doctors = get_posts(array('post_type' => 'doctor', 'tax_query' => array(array('taxonomy' => $taxonomy, 'field' => 'id', 'terms' => $term_id))));
        if ($doctors) {
            if ($posted_data['post_name'] == 'departments') {
                $page_url = get_site_url() . '/departments';
            } else {
                $page_url = get_site_url() . '/departments/' . $posted_data['post_name'];
            }
            $emails = array();
            $subject = 'Вопрос с сайта ' . get_site_url();
            $message = $posted_data['your-name'] . ' оставил(а) вопрос на странице: ' . $page_url;
            $headers = 'From: ' . get_bloginfo() . ' <no-reply@' . $_SERVER['SERVER_NAME'] . '>' . "\r\n";
            foreach ($doctors as $post) {
                setup_postdata($post);
                $author = get_user_by('login', get_the_author());
                $author_email = $author->user_email;
                array_push($emails, $author_email);
            }
            wp_reset_postdata();
            wp_mail($emails, $subject, $message, $headers);
        }
    }
    return $posted_data;
}
开发者ID:valerol,项目名称:artempol,代码行数:48,代码来源:departments.php


示例16: notification_email

 /**
  * Set the notification email when sending an email.
  *
  * @since WP Job Manager - Contact Listing 1.0.0
  *
  * @return string The email to notify.
  */
 public function notification_email($components, $cf7, $three = null)
 {
     $submission = WPCF7_Submission::get_instance();
     $unit_tag = $submission->get_meta('unit_tag');
     if (!preg_match('/^wpcf7-f(\\d+)-p(\\d+)-o(\\d+)$/', $unit_tag, $matches)) {
         return $components;
     }
     $post_id = (int) $matches[2];
     $object = get_post($post_id);
     if (!array_search($cf7->id, $this->forms[$object->post_type])) {
         return $components;
     }
     $recipient = $object->_application ? $object->_application : $object->_candidate_email;
     $components['recipient'] = $recipient;
     return $components;
 }
开发者ID:GaryJones,项目名称:dockerfiles,代码行数:23,代码来源:cf7.php


示例17: convertData

 /**
  * @param $cf7 WPCF7_ContactForm
  * @return object
  */
 public function convertData($cf7)
 {
     if (!isset($cf7->posted_data) && class_exists('WPCF7_Submission')) {
         // Contact Form 7 version 3.9 removed $cf7->posted_data and now
         // we have to retrieve it from an API
         $submission = WPCF7_Submission::get_instance();
         if ($submission) {
             $data = array();
             $data['title'] = $cf7->title();
             $data['posted_data'] = $submission->get_posted_data();
             $data['uploaded_files'] = $submission->uploaded_files();
             return (object) $data;
         }
     }
     return $cf7;
 }
开发者ID:rizzle-bizzle,项目名称:ards,代码行数:20,代码来源:CFDBIntegrationContactForm7.php


示例18: get_form_data

function get_form_data($cf7)
{
    $args = array('post_type' => 'rdcf7_integrations', 'posts_per_page' => 100);
    $forms = get_posts($args);
    foreach ($forms as $form) {
        $form_id = get_post_meta($form->ID, 'form_id', true);
        if ($form_id == $cf7->id) {
            $submission = WPCF7_Submission::get_instance();
            if ($submission) {
                $form_data = $submission->get_posted_data();
            }
            $form_data['token_rdstation'] = get_post_meta($form->ID, 'token_rdstation', true);
            $form_data['identificador'] = get_post_meta($form->ID, 'form_identifier', true);
            addLeadConversion($form_data);
        }
    }
}
开发者ID:anacaet,项目名称:rdstation-wp,代码行数:17,代码来源:lead-conversion.php


示例19: getFileURL

 /**
  * @codeCoverageIgnore
  */
 function getFileURL($filename)
 {
     if ($submission = \WPCF7_Submission::get_instance()) {
         $uploaded_files = $submission->uploaded_files();
         foreach ((array) $uploaded_files as $name => $path) {
             $fpi = pathinfo($path);
             if ($filename === $fpi["basename"] && !empty($path)) {
                 if (@is_readable($path)) {
                     $target = str_replace($fpi["filename"], uniqid("", true), $path);
                     $wpd = wp_upload_dir();
                     copy($path, sprintf("%s/%s", $wpd["path"], basename($target)));
                     wp_schedule_single_event(14 * DAY_IN_SECONDS, $this->delete_file_hook, array($target));
                     return sprintf("%s/%s", $wpd["url"], basename($target));
                 }
             }
         }
     }
     return $filename;
 }
开发者ID:niteoweb,项目名称:CF7GHQ,代码行数:22,代码来源:index.php


示例20: affwp_cf7_success_page_redirect

/**
 * Redirect the user to the thanks/success page after submitting the form
 *
 * @since 1.0
 */
function affwp_cf7_success_page_redirect($contact_form)
{
    // Success page ID
    $success_page = affwp_cf7_get_success_page_id();
    $submission = WPCF7_Submission::get_instance();
    // get the value of the name field
    $name = $submission->get_posted_data('your-name');
    // get the description
    $description = rawurlencode($contact_form->title());
    // add customer's email address to the description
    $description .= ' - ' . $submission->get_posted_data('your-email');
    // set the reference to be the first name
    $reference = isset($name) ? rawurlencode($name) : '';
    // redirect to success page
    if ($success_page) {
        $wpcf7 = WPCF7_ContactForm::get_current();
        $wpcf7->set_properties(array('additional_settings' => "on_sent_ok: \"location.replace(' " . add_query_arg(array('description' => $description, 'reference' => $reference, 'amount' => affwp_cf7_get_form_amount($contact_form->id())), get_permalink($success_page)) . " ');\""));
    }
}
开发者ID:companyjuice,项目名称:affiliatewp-code-snippet-library,代码行数:24,代码来源:contact-form-7.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP WPCF7_TagGenerator类代码示例发布时间:2022-05-23
下一篇:
PHP WPCF7_Shortcode类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap