Which is the best hook to use when creating a custom db table?
-
Hi all,
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?)
init
setup_theme
after_setup_theme
switch_theme
after_switch_themeThanks, Ron
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Which is the best hook to use when creating a custom db table?’ is closed to new replies.