Title: Adding New Rows
Last modified: August 22, 2016

---

# Adding New Rows

 *  Resolved [astewes](https://wordpress.org/support/users/astewes/)
 * (@astewes)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/adding-new-rows/)
 * In this plugin example, the table data is hardcoded into the PHP.
 * But what if I want to add table data dynamically, from the WordPress admin? What
   I have in mind is similar to the “Add New” link you see on Pages, Posts, and 
   many other pages.
 * I’m okay with having all table data stored in the database, and would like to
   avoid storing any of the data in the PHP file.
 * What’s the best approach for this?
 * [https://wordpress.org/plugins/custom-list-table-example/](https://wordpress.org/plugins/custom-list-table-example/)

Viewing 1 replies (of 1 total)

 *  Plugin Author [Dutch van Andel](https://wordpress.org/support/users/veraxus/)
 * (@veraxus)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/adding-new-rows/#post-5476212)
 * The plugin includes directions for this. The hard-coded “movie” data is for example/
   educational purposes.
 * The `prepare_items()` method is where you will query your own data and manipulate
   it. In that method, you will see a comment block that says **“In a real-world
   situation, this is where you would place your query.”** – that is where you would
   make your custom database query.
 * The easiest way to approach the plugin is to simple read it top to bottom, and
   make customizations along the way according to the comments and your needs.

Viewing 1 replies (of 1 total)

The topic ‘Adding New Rows’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/custom-list-table-example.svg)
 * [Custom List Table Example](https://wordpress.org/plugins/custom-list-table-example/)
 * [Support Threads](https://wordpress.org/support/plugin/custom-list-table-example/)
 * [Active Topics](https://wordpress.org/support/plugin/custom-list-table-example/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/custom-list-table-example/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/custom-list-table-example/reviews/)

## Tags

 * [database](https://wordpress.org/support/topic-tag/database/)
 * [pages](https://wordpress.org/support/topic-tag/pages/)
 * [posts](https://wordpress.org/support/topic-tag/posts/)
 * [wp_list_table](https://wordpress.org/support/topic-tag/wp_list_table/)

 * 1 reply
 * 2 participants
 * Last reply from: [Dutch van Andel](https://wordpress.org/support/users/veraxus/)
 * Last activity: [11 years, 3 months ago](https://wordpress.org/support/topic/adding-new-rows/#post-5476212)
 * Status: resolved