I create a new theme.
One of my targets is to enable the admin to add unique text (html code) to unique table which the theme will automatically create (I mean something like wp_myhtml
).
My questions are:
How to define that the theme will create a new table only at the first time the admin activate it (if the table exists - don't create again. I know to do it with pure PHP / SQL, but maybe there is an option with WordPress to create custom tables)?
How to CURD rows from this table via the panel? and only read via the website itself? are there unique functions to do this?
I don't use options
functions (add_option, update_option, etc) because the html codes can be very long, and one field of LONGTEXT won't handle it.
In addition, I don't use the editor (Appearence > Editor) because I need it in the DB.