Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Modify Contact Form 7 Submission Data

Featured Replies

Hi,

I'm using Contact Form 7 on a site and need to alter the checkbox submitted data. The checkbox has a label called 'Tick here if you dont want to receive further marketing', when this is checked the value sent in the admins notification email displays the checkbox label.

So it looks like:

 

Tick here if you dont want to receive further marketing: Tick here if you dont want to receive further marketing

 

I want to alter it so when its checked the value posted is No.

 

I believe I can use the following action hook to achieve this but I dont know how to check if the checkbox has been ticked within this function and modify its value.

 

Any help much appreciated.

// define the wpcf7_posted_data callback 
function action_wpcf7_posted_data( $array ) { 
    // make action magic happen here... 
}; 
         
// add the action 
add_action( 'wpcf7_posted_data', 'action_wpcf7_posted_data', 10, 1 );

 

  • Author

So far I’ve tried the following code but this changes the posted data to No when the checkbox is both checked or unchecked:



// define the wpcf7_posted_data callback
function action_wpcf7_posted_data( $array ) {

$value = $array['further-marketing'];
if( !empty( $value ) ){
$array['further-marketing'] = "No";
}

return $array;
};

// add the action
add_action( 'wpcf7_posted_data', 'action_wpcf7_posted_data', 10, 1 );

Any help would be greatly appreciated.


  • 2 weeks later...

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.