Title: editable database
Last modified: August 20, 2016

---

# editable database

 *  Resolved [nikstabm](https://wordpress.org/support/users/nikstabm/)
 * (@nikstabm)
 * [13 years, 4 months ago](https://wordpress.org/support/topic/editable-database/)
 * I would like to edit the records (launch pdb_record) from the database (pdb_list).
   Is there a way to do this with the plug in currently? Would I need to edit the
   plug in?
 * What I would like to do is when a link is clicked in the database on the front
   end (pdb_list) that would normally launch pdb_single, I would like it to launch
   pdb_record so they can edit the database. In the back end this is possible by
   clicking on the private_id field. I can make the private_id field visible on 
   the front end, but it does not have a link like it does in the back end.
 * Thanks!
 * [http://wordpress.org/extend/plugins/participants-database/](http://wordpress.org/extend/plugins/participants-database/)

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

 *  Plugin Author [Roland Barker](https://wordpress.org/support/users/xnau/)
 * (@xnau)
 * [13 years, 3 months ago](https://wordpress.org/support/topic/editable-database/#post-3473967)
 * You need to create a custom template, then put this code into the template, right
   after the line with “$this->the_field()” in it:
 *     ```
       <?php if ($this->field->name = 'private_id') {
          $record_page = get_permalink($this->options['registration_page']);
          $private_link = $record_page . (strpos($record_page,'?') ? '&' : '?' ) . http_build_query(array('pid'=>$this->field->value));
          $this->field->value = sprintf('<a href="%s">%s</a>',$private_link,'Edit');
       } ?>
       ```
   
 * The string “Edit” can be whatever you want to be the clickable text.
 *  Thread Starter [nikstabm](https://wordpress.org/support/users/nikstabm/)
 * (@nikstabm)
 * [13 years, 3 months ago](https://wordpress.org/support/topic/editable-database/#post-3474114)
 * Thanks for the fast response!
 * I’m looking in participants-database/classes/Template_Item.class.php and cannot
   find “$this->the_field()” . Am I looking in the right place?
 *  Thread Starter [nikstabm](https://wordpress.org/support/users/nikstabm/)
 * (@nikstabm)
 * [13 years, 3 months ago](https://wordpress.org/support/topic/editable-database/#post-3474115)
 * I am not sure what you are referring to in creating a new template. It seems 
   to me that I need to edit pdb_list.class.php and add in the functionality you
   created above. The only class I found $this->;the_field() is in the pdb_shortcode.
   class.php. Would I need to create a new shortcode to output the database with
   a link that is editable?
 *  Plugin Author [Roland Barker](https://wordpress.org/support/users/xnau/)
 * (@xnau)
 * [13 years, 3 months ago](https://wordpress.org/support/topic/editable-database/#post-3474116)
 * nikstabm,
 * Read [this page](http://wordpress.org/extend/plugins/participants-database/other_notes/)
   on creating custom templates. You’re basically copying the default list template(
   templates/pdb-list-default.php) into your WP theme directory and then editing
   that file. There’s no need to edit the plugin core files.
 *  [vrapto](https://wordpress.org/support/users/vrapto/)
 * (@vrapto)
 * [13 years, 3 months ago](https://wordpress.org/support/topic/editable-database/#post-3474126)
 * Hi Xnau
 * Thanks for all the support and prompt responses.
 * I had the same request as nikstabm and was able to add
    <?php if ($this->field-
   >name = ‘private_id’) { $record_page = get_permalink($this->options[‘registration_page’]);
   $private_link = $record_page . (strpos($record_page,’?’) ? ‘&’ : ‘?’ ) . http_build_query(
   array(‘pid’=>$this->field->value)); $this->field->value = sprintf(‘[%s](https://wordpress.org/support/topic/editable-database/%s?output_format=md)‘,
   $private_link,’Edit’); } ?>
 *  and bang **it works** on [pdb_list template=”test” fields=”first_name,private_id”]
 * Now private_id is a link but unfortunately first_name is displaying as [Edit](http://mywebsite.co.za/client-record/?pid=vrapto).
   
   All i need is the name displayed with the link (that now works). WP version 3.5.1
   PDB Version 1.4.9.1
 * Thank you
 * P.S. been through hundreds of WP plugins and have never seen a plugin as comprehensively
   documented as yours. Really good work.
 *  Plugin Author [Roland Barker](https://wordpress.org/support/users/xnau/)
 * (@xnau)
 * [13 years, 3 months ago](https://wordpress.org/support/topic/editable-database/#post-3474127)
 * You have a tiny littler error in your code: in the first line, the “if” statement
   should read
 * `<?php if ($this->field->name == 'private_id') {`
 * The double equals sign “==” is used to indicate a comparison, a single “=” indicates
   an assignment, which always resolves to true. So it was applying your modification
   to all fields.
 *  [vrapto](https://wordpress.org/support/users/vrapto/)
 * (@vrapto)
 * [13 years, 3 months ago](https://wordpress.org/support/topic/editable-database/#post-3474128)
 * Thank you, much appreciated and it works.

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

The topic ‘editable database’ is closed to new replies.

 * ![](https://ps.w.org/participants-database/assets/icon-256x256.jpg?rev=1389807)
 * [Participants Database](https://wordpress.org/plugins/participants-database/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/participants-database/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/participants-database/)
 * [Active Topics](https://wordpress.org/support/plugin/participants-database/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/participants-database/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/participants-database/reviews/)

 * 7 replies
 * 3 participants
 * Last reply from: [vrapto](https://wordpress.org/support/users/vrapto/)
 * Last activity: [13 years, 3 months ago](https://wordpress.org/support/topic/editable-database/#post-3474128)
 * Status: resolved