WordPress.org

Forums

Contact Form 7
Get value radio button and set additional setting (1 post)

  1. Fallensoul99
    Member
    Posted 11 months ago #

    New update *Head-bang* ! Documentation is terse.

    Question 1: How do I get the value from the radio button.

    This is my functions.php

    add_action ('wpcf7_before_send_mail','wpcf7_redirect');
    function wpcf7_redirect ($wpcf7) {
    $submission = WPCF7_Submission::get_instance();
    if ( $submission ) {
    $form_data = $submission->get_posted_data();
    }
    $language = reset($form_data['radio-946']);

    I have to use reset to get the first value from the array. It should just give me the value right? Anyway this currently works but it seems wrong.

    This works for me if people are pulling their hair out trying to redirect:

    $url = "on_sent_ok: \"location = 'http://www.google.com';\"";
    $wpcf7->set_properties(array ('additional_settings' => $url));

    https://wordpress.org/plugins/contact-form-7/

Reply

You must log in to post.

About this Plugin

  • Contact Form 7
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic

  • RSS feed for this topic
  • Started 11 months ago by Fallensoul99
  • This topic is not resolved
  • WordPress version: 3.9.1

Tags

No tags yet.