0

I'm making a plugin for WordPress and it requires some custom tables of mine (or the data in them, to be specific). These tables are simple. They only contain an id and a varchar field. Do not mention meta fields. I am using custom tables for a reason. The problem is, I need to allow the user to edit the data in these tables. To insert, update and delete rows in the tables. How do I handle this in WordPress?

I can make my own custom pages and create a whole system for editing, inserting and updating them but that's a workaround since none of that would be native to WordPress.

The only thing I came up with is making them into custom post types and having WordPress let me use its native adding, editing and deleting menu (the same one used in posts, pages, etc.). Though then new problems would arise. I need to connect the post ids to the rows in the custom tables and be very careful when editing, updating and deleting to make sure that both the posts and my custom table data remain consistent with each other. And that's a whole new layer of complexity.

So I was wondering if there's an elegant way to handle these sorts of simple tables. If there isn't I'll find my own workaround.

EDIT:

The plugin I'm making is supposed to turn your WordPress site into a kind of an ad posting site. And I need the custom tables to provide details about the ads.

2
  • Can you provide more details about the system you're building ? actually if it is simple you can make it looks like native Wordpredd. Commented Jun 23, 2014 at 11:27
  • @hutchbat I added a little explanation. Commented Jun 23, 2014 at 12:14

1 Answer 1

2

refer this codex Wp_list_table. you can play with custom table data. for more you can go through an example plugin.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.