Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I have successfully created a wp-LINKS-list-table that displays the output of WP's core "Links" table in the WP Dashboard, and I have it displaying on a menu page I created. Step 1 accomplished!

But now I would like to be able to have the single row edit/delete (database) functionality just like the Links page. Right now I can edit/delete the links, but it's just adding/removing items from the actual links database table. I'm assuming that I not only have to create a different database table for my own queries, but I need to process my pages outside of the WordPress core as well. Right?

Or is there a core WP functionality that I can use to edit/delete my own table items?

share|improve this question
add comment

1 Answer 1

up vote 1 down vote accepted

Wordpress allows you to use a class called wpdb

Here is an example of how you would use it
function add_to_db() {
global $wpdb;
$your_table_name = $wpdb->prefix . "wp-LINKS-list-table";
$the_value = '123';
$wpdb->insert( $your_table_name, array('column_name' => $the_value,));

this will insert 123 into the column_name. You can read more here

Note: If you are creating a menu page that reflects the tables similar to the wordpress tables there is another class you can use to help you. It is called WP_List_Table I would suggest reading that and getting the Custom List Table Example Plugin it is very helpful showing examples of using WP_List_Table.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.