plugin development with custom database tables
-
Hola,
Bit more of a generic development question, so apologies if this is the wrong section, but I am rather lost after looking at the documentation and googling with this.
So wanted to ask seasoned developers if there is a better solution to do what I want. Writing a plugin at the moment that will create 2 extra tables to core wp which will store some data that registered users can post.
Say as an example its a book database, so one table will have book category and the other book titles (with some random meta data, like dates, users who post that). So the tables would look like:
table1:
id, varchar, date, user
table2:
id, int, date, table_1_link, userSomething along these lines, so the real question is, can I use the API that wp provides to create this (and if so a tip pointed at the right direction would be appreciated)? For example to output an actions menu for a specific “page” looking url https://www.example.com/books/new or https://www.example.com/books/edit I don’t quiet mind how actions are represented as urls, just as long as they are sensible. Can I somehow catch the actions that I want using wp rather then referring to $_POST[‘action’] in the plugin?
Tried using custom_post_type, but I don’t think this is what I am looking for, since the data I want to store/display isn’t a massive text field but is not shared between users (so their book database example would be private to themselves).
So far the only way to do what I want involves creating a page where the plugin runs from with [plugin] and in the plugin trying to catch actions for new/edit/delete using $_POST. Is there a more sensible framework like solution for this in wp (that I just keep missing)?
Cheers for the help!
- The topic ‘plugin development with custom database tables’ is closed to new replies.