Create Custom Tables In WordPress
Paulund is full of premium tutorials and support to help with your development
Sign up to get full access to all tutorials.
If you are creating your own WordPress plugin you may want to store data inside the WordPress database. There are a few options that you can use for this, you can create a custom settings page using the Settings API, save the data directly in the option table by using set_option() and get_option() or the third option is to create your own database tables and store your data in here. In this tutorial we are going to look at the process of how you will create custom tables in your WordPress plugin. When you use a plugin that will use custom tables you need to make sure that these tables will exist before you try to store data in them. To make sure that these tables exist you should automatically create these tables when the plugin is activated. WordPress has a function hook that you can use to run a...