Title: &#8216;default_values&#8217; not working
Last modified: June 19, 2019

---

# ‘default_values’ not working

 *  Resolved [kentauron](https://wordpress.org/support/users/kentauron/)
 * (@kentauron)
 * [6 years, 11 months ago](https://wordpress.org/support/topic/default_values-not-working/)
 * Hi,
 * when ‘default_values’ param is defined, field values flush immediately after 
   edited, as soon as cursor moves to another field
 * ex: ‘default_values’=>’Array(“supp_code”=>”abc”)’,
 * Thank you

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

 *  Plugin Author [bobbysmith007](https://wordpress.org/support/users/bobbysmith007/)
 * (@bobbysmith007)
 * [6 years, 11 months ago](https://wordpress.org/support/topic/default_values-not-working/#post-11661674)
 * hrmm… I havent experienced that particularly. I just tested it on a local instance
   with the latest version and I was able to set default_values that worked.
 * I did notice a weirdness. Usually as soon as you edit the “new” row, it will 
   fill in all the default values at once. However if you edit the column with a
   default value in it first. It replaces the value typed in with the default value.
   I didn’t see it clearing anything, but maybe its related. Anyway, thank you for
   your comment as it uncovered a bug.
 * Cheers,
    Russ
 *  Thread Starter [kentauron](https://wordpress.org/support/users/kentauron/)
 * (@kentauron)
 * [6 years, 11 months ago](https://wordpress.org/support/topic/default_values-not-working/#post-11661690)
 * Maybe the real issue is that a new row is not created, so what edited flushes
   away
 *  Plugin Author [bobbysmith007](https://wordpress.org/support/users/bobbysmith007/)
 * (@bobbysmith007)
 * [6 years, 11 months ago](https://wordpress.org/support/topic/default_values-not-working/#post-11661693)
 * So when you type into the “new row” at the end of the page, it immediately adds
   a new “new-row” just below it. That is so you could add multiple rows at once(
   not super recommended anyway, but… ). This shouldn’t disrupt the original new
   row you were editing. Perhaps, that older new-row is resorted weird?
 *  Thread Starter [kentauron](https://wordpress.org/support/users/kentauron/)
 * (@kentauron)
 * [6 years, 11 months ago](https://wordpress.org/support/topic/default_values-not-working/#post-11661707)
 * When ‘default_values’ is set no new row is created when you start to edit the
   last blank row
 *  Thread Starter [kentauron](https://wordpress.org/support/users/kentauron/)
 * (@kentauron)
 * [6 years, 11 months ago](https://wordpress.org/support/topic/default_values-not-working/#post-11661718)
 * Anyway for on of my needs (add the current username to a field) I added a new
   argument to the plugin code: $current_user_column (on class DBTableEditor)
    and
   after the no_edit_cols check “if($no_edit_cols){“, the following code to add 
   the current username in that hidden field:
 *  $current_user = $cur->current_user_column;
    if(is_string($current_user)) $current_user
   =explode(‘,’,$current_user); if($current_user){ foreach($current_user as $c_user){
   $wp_current_user = wp_get_current_user(); $up[$c_user] = $wp_current_user->display_name;}}
    -  This reply was modified 6 years, 11 months ago by [kentauron](https://wordpress.org/support/users/kentauron/).
 *  Thread Starter [kentauron](https://wordpress.org/support/users/kentauron/)
 * (@kentauron)
 * [6 years, 11 months ago](https://wordpress.org/support/topic/default_values-not-working/#post-11668368)
 * There was an error in writing the arg, no bug.
    ‘default_values’ arg works fine
 *  Plugin Author [bobbysmith007](https://wordpress.org/support/users/bobbysmith007/)
 * (@bobbysmith007)
 * [6 years, 11 months ago](https://wordpress.org/support/topic/default_values-not-working/#post-11668373)
 * Thanks for updating this issue, glad you got it fixed.

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

The topic ‘‘default_values’ not working’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/wp-db-table-editor.svg)
 * [WP-DB-Table-Editor](https://wordpress.org/plugins/wp-db-table-editor/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-db-table-editor/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-db-table-editor/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-db-table-editor/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-db-table-editor/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-db-table-editor/reviews/)

 * 7 replies
 * 2 participants
 * Last reply from: [bobbysmith007](https://wordpress.org/support/users/bobbysmith007/)
 * Last activity: [6 years, 11 months ago](https://wordpress.org/support/topic/default_values-not-working/#post-11668373)
 * Status: resolved