Title: ch8rt's Replies | WordPress.org

---

# ch8rt

  [  ](https://wordpress.org/support/users/ch8rt/)

 *   [Profile](https://wordpress.org/support/users/ch8rt/)
 *   [Topics Started](https://wordpress.org/support/users/ch8rt/topics/)
 *   [Replies Created](https://wordpress.org/support/users/ch8rt/replies/)
 *   [Reviews Written](https://wordpress.org/support/users/ch8rt/reviews/)
 *   [Topics Replied To](https://wordpress.org/support/users/ch8rt/replied-to/)
 *   [Engagements](https://wordpress.org/support/users/ch8rt/engagements/)
 *   [Favorites](https://wordpress.org/support/users/ch8rt/favorites/)

 Search replies:

## Forum Replies Created

Viewing 15 replies - 1 through 15 (of 15 total)

 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Post Notification by Email] Does not send mail from 4.3.1](https://wordpress.org/support/topic/does-not-send-mail-from-431/)
 *  [ch8rt](https://wordpress.org/support/users/ch8rt/)
 * (@ch8rt)
 * [9 years, 6 months ago](https://wordpress.org/support/topic/does-not-send-mail-from-431/#post-8467935)
 * I’m not sure if this is related, but I’ve had to set a ‘to’ address in wp_mail()
   on line 461 of notify-users-e-mail.php to get this running again. I’ve also set
   the ‘From’ address n $headers (just above) as well, to override the default behaviour.
 * Like the posts above, I had no errors, and other services were using wp_mail()
   just fine on the same server.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Developer's Custom Fields] optgroup in post query select](https://wordpress.org/support/topic/optgroup-in-post-query-select/)
 *  Thread Starter [ch8rt](https://wordpress.org/support/users/ch8rt/)
 * (@ch8rt)
 * [12 years, 5 months ago](https://wordpress.org/support/topic/optgroup-in-post-query-select/#post-4482779)
 * Whilst I’m still look for a better option, this is my solution thus far.
 * Around line 516 in slt_cf_init.php I replaced…
 *     ```
       $current_category = array();
       foreach ( $posts as $post_data ) {
       	if ( $field[ 'group_options' ] ) {
   
       		$this_category = get_the_category( $post_data->ID );
   
       		if ( empty( $current_category ) || $this_category[0]->cat_ID != $current_category[0]->cat_ID ) {
       			// New category, initiate an option group
       			$field['options'][ $this_category[0]->cat_name ] = '[optgroup]';
       			$current_category = $this_category;
       		}
       	}
       ```
   
 * …with…
 *     ```
       $current_post_type = array();
       foreach ( $posts as $post_data ) {
       	if ( $field[ 'group_options' ] ) {
   
       		$this_post_type = get_post_type( $post_data->ID );
       		$this_post_type = get_post_type_object( $this_post_type );
   
       		if ( empty( $current_post_type ) || !in_array( $this_post_type->name, $current_post_type ) ) {
       			// New category, initiate an option group
       			$field['options'][ $this_post_type->name ] = '[optgroup]';
       			array_push( $current_post_type, $this_post_type->name );
       		}
       	}
       ```
   
 * Which essentially switch the grouping from categories (which I’m not using) to
   post types.
 * The next problem was that the posts don’t come out in post-type order, rather
   they are mixed up. And there is no out of the box orderby parameter for post-
   type so I’ve resorted to creating a hidden meta field that stores the post-type
   name for each post – thus I can use the meta_value and orderby value options 
   that are available.
 * It works a treat really, and seeing Steve’s notes in vicinity suggesting that
   this grouping feature might get expanded beyond category makes me think it’ll
   do for now.
 * But as before andy views would be most welcome, this stuff doesn’t come naturally
   to me.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Contact Form DB] Hide Some Columns in Admin -> Contact Form DB submissions](https://wordpress.org/support/topic/hide-some-columns-in-admin-contact-form-db-submissions/)
 *  [ch8rt](https://wordpress.org/support/users/ch8rt/)
 * (@ch8rt)
 * [12 years, 9 months ago](https://wordpress.org/support/topic/hide-some-columns-in-admin-contact-form-db-submissions/#post-4059155)
 * I’ve seen it mentioned a few times that this isn’t easy to do, although you can
   use the short code functions to output tailored views of the content.
 * You can cheat it with CSS though, all the table cells have names attached that
   you can target. So this will work…
 *     ```
       th[title=Submitted],
       td[title=Submitted] {
       display: none;
       }
       ```
   
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Contact Form DB] [Plugin: Contact Form 7 to Database Extension] Saving multiple form fields into the same column](https://wordpress.org/support/topic/plugin-contact-form-7-to-database-extension-saving-multiple-form-fields-into-the-same-column/)
 *  [ch8rt](https://wordpress.org/support/users/ch8rt/)
 * (@ch8rt)
 * [12 years, 9 months ago](https://wordpress.org/support/topic/plugin-contact-form-7-to-database-extension-saving-multiple-form-fields-into-the-same-column/#post-3093426)
 * I started on this issue myself and seem to have found a solution, I posted it
   in this thread…
    [http://wordpress.org/support/topic/create-new-record-for-each-selection-in-a-submitted-form?replies=3#post-4613418](http://wordpress.org/support/topic/create-new-record-for-each-selection-in-a-submitted-form?replies=3#post-4613418)
 * Basically stopping the looping by checking for a field that only exists the first
   time around – which seems to do the trick.
 * I’ve used this to submit multiple records to a new form database thats linked
   to the original by an id. eg. Mr Smith makes 4 seperate bookings.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Contact Form DB] Create new record for each selection in a submitted form?](https://wordpress.org/support/topic/create-new-record-for-each-selection-in-a-submitted-form/)
 *  [ch8rt](https://wordpress.org/support/users/ch8rt/)
 * (@ch8rt)
 * [12 years, 9 months ago](https://wordpress.org/support/topic/create-new-record-for-each-selection-in-a-submitted-form/#post-4050192)
 * I think I’ve managed to do what you guys are looking at.
 * I’m working on a booking form which allows the user to book more than one item,
   I’m using a function similar to the one below to then split booking items off
   into another table leaving behind the base level information and a reference.
 * Meaning that I have one ‘booker’ to many ‘booking items’ with an ID linking them
   together.
 * Here’s a run through of what I’m doing, but based of the OPs example (in the 
   theme functions.php)…
 *     ```
       function multiPost($formData){
   
           // Check for a field thats only in the first submit, else we'll get looping that breaks saveFormData()
           if( $formData->posted_data['place-name2'] ) {
   
       	    $formName 		= 'Booking Form';
       	    $additionalForm = array('2');
   
       	    // Check for additional form items – rinse and repeat if needed
       		if( $formData->posted_data['place-name3'] ) {
       			array_push($additionalForm, '3');
       		}
   
           	// New form submit for each additional form
           	foreach ($additionalForm as $c) {
   
           		// Additional submission – works fine to a seperate form but not the same.
           		$cfdb = new CF7DBPlugin();
   
           		$data = (object) array(
           		    'title' => $formNameItems,
           		    'posted_data' => array(
   
           			    'placename'		=> $formData->posted_data['placename' . $c],
           			    'dataField'		=> $formData->posted_data['dataField'],
           			    'emailField'	=> $formData->posted_data['emailField']
   
           			)
           		);
   
           		// Save new record
           		$cfdb->saveFormData($data);
   
           		// We don't need placename2/3/4... in the original record
           		unset($formData->posted_data['placename' . $c]);
   
           	}
   
           	// Tidy up original record, essentially moving placename1 to placename and then removing placename1 so columns match
           	$formData->posted_data['placename'] = $formData->posted_data['placename1'];
           	unset($formData->posted_data['placename']);
   
           }
   
           return $formData;
   
       }
   
       add_filter('cfdb_form_data', 'multiPost');
       ```
   
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Contact Form DB] [Plugin: Contact Form 7 to Database Extension] Saving multiple form fields into the same column](https://wordpress.org/support/topic/plugin-contact-form-7-to-database-extension-saving-multiple-form-fields-into-the-same-column/)
 *  [ch8rt](https://wordpress.org/support/users/ch8rt/)
 * (@ch8rt)
 * [12 years, 11 months ago](https://wordpress.org/support/topic/plugin-contact-form-7-to-database-extension-saving-multiple-form-fields-into-the-same-column/#post-3093420)
 * Apologies for bringing this back but it seemed the nearest topic on the issue
   I’m trying to resolve – that is to post multiple entries to the same form Db 
   from a single form.
 * I don’t pretend to fully understand these things, but having played around with
   this for a few hours it seems that the problem is that in the above example the
   saveFormData lines are activating this filter again, causing a continuous loop–
   hence the hang up.
 * I’ve not yet decided on the implementation in my project (I’m just scoping at
   the moment) but adding an additional check in the ‘if’ statement for something
   that appears (or doesn’t) in the first entry only seems to do the trick.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Gravity Forms Directory] [Plugin: Gravity Forms Directory & Addons] Admin edit link](https://wordpress.org/support/topic/plugin-gravity-forms-directory-addons-admin-edit-link/)
 *  Thread Starter [ch8rt](https://wordpress.org/support/users/ch8rt/)
 * (@ch8rt)
 * [14 years, 7 months ago](https://wordpress.org/support/topic/plugin-gravity-forms-directory-addons-admin-edit-link/#post-2365067)
 * Anyone?
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Gravity Forms Directory] [Plugin: Gravity Forms Directory & Addons] Admin edit link](https://wordpress.org/support/topic/plugin-gravity-forms-directory-addons-admin-edit-link/)
 *  Thread Starter [ch8rt](https://wordpress.org/support/users/ch8rt/)
 * (@ch8rt)
 * [14 years, 7 months ago](https://wordpress.org/support/topic/plugin-gravity-forms-directory-addons-admin-edit-link/#post-2365025)
 * Basically I think I need a way to get $lead_id to punch out in the following 
   function. It doesn’t though and I can’t for the life of me figure this one out.
 *     ```
       add_filter('kws_gf_directory_value_15', 'admin_editlink');
       		function admin_editlink($content) {
       		    return str_replace('Edit', '<a target="_blank" href="http://localhost/pe/wp-admin/admin.php?page=gf_entries&view=entry&id=1&lid=' . $lead_id . '&paged=1">t' . $lead_id . '</a>' , $content);
       		}
       ```
   
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Gravity Forms Directory] [Plugin: Gravity Forms Directory & Addons] Admin edit link](https://wordpress.org/support/topic/plugin-gravity-forms-directory-addons-admin-edit-link/)
 *  Thread Starter [ch8rt](https://wordpress.org/support/users/ch8rt/)
 * (@ch8rt)
 * [14 years, 7 months ago](https://wordpress.org/support/topic/plugin-gravity-forms-directory-addons-admin-edit-link/#post-2365024)
 * Any ideas on this? I’ve been trying to use the hooks mentioned in the FAQs to
   work around this but I can’t for the life of me echo the entry id anywhere.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Developer's Custom Fields] [Plugin: Developer's Custom Fields] Help with advanced options type](https://wordpress.org/support/topic/plugin-developers-custom-fields-help-with-advanced-options-type/)
 *  Thread Starter [ch8rt](https://wordpress.org/support/users/ch8rt/)
 * (@ch8rt)
 * [14 years, 8 months ago](https://wordpress.org/support/topic/plugin-developers-custom-fields-help-with-advanced-options-type/#post-2346976)
 * Oh, new documentation ?
 * I’ll take a look. Thanks Steve.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Developer's Custom Fields] [Plugin: Developer's Custom Fields] Google Maps API](https://wordpress.org/support/topic/plugin-developers-custom-fields-google-maps-api/)
 *  Thread Starter [ch8rt](https://wordpress.org/support/users/ch8rt/)
 * (@ch8rt)
 * [14 years, 8 months ago](https://wordpress.org/support/topic/plugin-developers-custom-fields-google-maps-api/#post-2268655)
 * Nice Steve. Looking forward to it.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Developer's Custom Fields] Outputting files / images](https://wordpress.org/support/topic/outputting-files-images/)
 *  Thread Starter [ch8rt](https://wordpress.org/support/users/ch8rt/)
 * (@ch8rt)
 * [14 years, 9 months ago](https://wordpress.org/support/topic/outputting-files-images/#post-2268907)
 * Super fast reply, thanks Steve.
 * I was stuck in your plugin documentation then, rather than thinking about WP 
   functions. 🙂 Doh!
 * ta.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Developer's Custom Fields] [Plugin: Developer's Custom Fields] Google Maps API](https://wordpress.org/support/topic/plugin-developers-custom-fields-google-maps-api/)
 *  Thread Starter [ch8rt](https://wordpress.org/support/users/ch8rt/)
 * (@ch8rt)
 * [14 years, 9 months ago](https://wordpress.org/support/topic/plugin-developers-custom-fields-google-maps-api/#post-2268475)
 * Nice one Steve. Appreciate it.
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [Password reset key not valid](https://wordpress.org/support/topic/password-reset-key-not-valid/)
 *  Thread Starter [ch8rt](https://wordpress.org/support/users/ch8rt/)
 * (@ch8rt)
 * [15 years, 2 months ago](https://wordpress.org/support/topic/password-reset-key-not-valid/#post-1979347)
 * Yeah, the problem is its doing it for every user, so each time someone forgets
   their password they’ll need this to work. Which it doesn’t.
 * I’m going to try a fresh install at some point to see if it fixes, but I was 
   hoping it wouldn’t come to that.
 * On top of that I’m moving my users from phpbb and the passwords haven’t transfered
   so has it stands I need every user to go through the reset process, which they
   can’t if it doesn’t work. 🙁
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Plugin: LeagueManager] Error on article posting](https://wordpress.org/support/topic/plugin-leaguemanager-error-on-article-posting/)
 *  Thread Starter [ch8rt](https://wordpress.org/support/users/ch8rt/)
 * (@ch8rt)
 * [15 years, 11 months ago](https://wordpress.org/support/topic/plugin-leaguemanager-error-on-article-posting/#post-1446618)
 * Didn’t realise that I had not replied. Thanks for this, it worked beautifully.

Viewing 15 replies - 1 through 15 (of 15 total)