I have a need to create a custom table from within my theme functions.php file, NOT from a plugin.
I can just put the code in-line but suspect it would be more efficient to contain it in function that is called ideally just once, ever.
So what is the best hook to use in this sample code?
add_action( '<hook>', 'create_my_custom_table');
Here are some options I think might work (I know init does, but isn’t it executed once for every user session?)
- The topic ‘Which is the best hook to use when creating a custom db table?’ is closed to new replies.