• Resolved jayroyall

    (@jayroyall)


    Hi,

    I’m very new to WordPress so please excuse me if I seem ignorant towards the functionality of Worpress.

    I would like to develop a custom plugin that allows administrators of the website to send push notifications for registered users (both individual user and groups of users) and I’m not sure of the best method to accomplish this. I’ve done this sort of thing within other CMSs but I’m unfamiliar with what WordPress can offer with regards to adding custom entities and fields.

    My understanding, and please correct me if I’m wrong, is that there are two options. Option 1 is to use WordPress to create custom post types, and option two is to manually create tables in the WordPress database and use those tables to store my custom data.

    Is my understanding correct? If so then could someone give me a few pros and copns of each method. If I’m wrong then I’d appreciate someone pointing me in the right direction.

    Thanks in advance for your time.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Moderator bcworkz

    (@bcworkz)

    You can do anything you want that is within the abilities of PHP, which is quite extensive. There are a few things related to the WP environment that you shouldn’t do, like alter core code. There is nothing wrong with either of your suggestions, you could realistically go either way.

    I would recommend trying to work within the existing WP data structure if it’s reasonably feasible. The reasons to go with custom tables (IMO) should be if the nature of your data requires queries by specific columns in order to be efficient due to a large quantity of data. Since post or user meta stores all values in the same column, accessed via keys, post or user meta queries are inherently less efficient than where only the data of interest occurs in the column.

    If the number of posts or users is reasonable, post and user meta queries will be fine despite being less efficient. It’s only when you’re anticipating dealing with quite large datasets that custom tables make sense. Or the nature of your data just does not make sense as post or user meta.

    This philosophy is my own, I’m sure others would argue otherwise. There is no generally right or wrong here, the best approach is a judgment call. As long as you are just extending the WP installation and not altering the core configuration, it’s up to you which way to go.

    Thread Starter jayroyall

    (@jayroyall)

    Thanks a lot for taking the time to help me out. You’ve been a big help and given me a good starting point with this project. Still not sure of which approach to take yet but I now know a little bit more of the workings of WP which will help me to makle the decision.

    Thanks again, really appreciate it 🙂

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Custom Entities and Fields’ is closed to new replies.