Title: Update problem with update_cb callback function
Last modified: August 22, 2016

---

# Update problem with update_cb callback function

 *  Resolved [Nikomuse](https://wordpress.org/support/users/nikomuse/)
 * (@nikomuse)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/update-problem-with-update_cb-callback-function/)
 * Hi,
 * I tried to use an ‘update_cb’ callback function passing it to the add_db_table_editor
   function but unfortunately, I don’t get the row id in the given parameters : 
   $dbte, $vals, $columns, $idxs.
 * Thanks for the plugin by the way…
    Regards, Nicolas.
 * [https://wordpress.org/plugins/wp-db-table-editor/](https://wordpress.org/plugins/wp-db-table-editor/)

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

 *  Thread Starter [Nikomuse](https://wordpress.org/support/users/nikomuse/)
 * (@nikomuse)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/update-problem-with-update_cb-callback-function/#post-5803383)
 * In the dbte_save_cb function of the db-table-editor.php file, in the condition
   at the line 349, you don’t send any id to $cur->update_cb function, but in the‘
   else’ closure, id is well set in the $where variable.
 * If I may suggest this fix, l.350 :
    call_user_func($cur->update_cb,$cur, $up,
   $cols, $idxs[$ridx], $id);
 * Regards,
    Nicolas.
 *  Plugin Author [bobbysmith007](https://wordpress.org/support/users/bobbysmith007/)
 * (@bobbysmith007)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/update-problem-with-update_cb-callback-function/#post-5803492)
 * I just updated the version to 1.3 With the changes you have suggested in place.
   Thanks for the bug report. In my one case of using the callbacks, I had to recompute
   the ID anyway, so it was not missed, but it certainly does make sense to pass
   it.
 * I think next time I have to change the API of these functions I will change them
   to using an array of keyword arguments instead so that additive changes to the
   API are less likely to cause problems.
 * Added ID to callbacks / actions where it makes sense
    * update_cb, delete_cb,
   dbt_row_updated
 *  Thread Starter [Nikomuse](https://wordpress.org/support/users/nikomuse/)
 * (@nikomuse)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/update-problem-with-update_cb-callback-function/#post-5803499)
 * Ok. Great, thanks !
 * Regards.

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

The topic ‘Update problem with update_cb callback function’ 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/)

 * 3 replies
 * 2 participants
 * Last reply from: [Nikomuse](https://wordpress.org/support/users/nikomuse/)
 * Last activity: [11 years, 3 months ago](https://wordpress.org/support/topic/update-problem-with-update_cb-callback-function/#post-5803499)
 * Status: resolved