Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Creating a custom products table #7

Open
louwie17 opened this issue Dec 21, 2021 · 0 comments
Open

Creating a custom products table #7

louwie17 opened this issue Dec 21, 2021 · 0 comments

Comments

@louwie17
Copy link
Owner

Description

In #5, we created a rest endpoint for products and saved them using update_option, this is not sustainable when handling hundreds/thousands of products, instead we should create our own table for our plugin to handle products.

How to create a custom table can be seen here: https://codex.wordpress.org/Creating_Tables_with_Plugins
We can then make use of $wpdb to retrieve products and make use of this in our REST endpoint.

For now we should only make the id indexed, although suggestions are welcome here.

As part of this issue it might be worth going through an SQL tutorial if you are not as familiar with SQL, here is a simple tutorial from W3Schools -> https://www.w3schools.com/sql/sql_intro.asp, but any other would suffice as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant