Edit Custom Database Tables in WordPress

Some notes before: This is only how I’d approach it – I’m not going to step more into detail, because basically it’s a list of plugins you’ll have to code.

Build a Back-End page

Use the function add_menu_page to add a page. Then build your management tables extending the WP_List_Table class:

class WPSE_48824_List_Table extends WP_List_Table
{
    // do stuff
}

// Use it:
$list_table = new WPSE_48824_List_Table();
$list_table->display();

Handling the DB

Basically you’re going to have a lot of DB requests. Use the $wpdb object/Class.

Don’t forget to $wpdb->prepare() your data before inserting it.

Also make use of $wpdb->prefix instead of hardcoding it.

Bulk actions

Will run via Ajax. More can be read on Ajax for Plugins in Code or here on WPSE in the tag archive .

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)