How to do one-off import or data migration?
Here’s what I would suggest – store your theme version in the database, compare it with your package version, if there’s a difference then load in your upgrade/install operations: define( ‘THEME_PREFIX_VERSION’, ‘X.X’ ); /** * Run upgrade/install. */ function theme_prefix_install() { require_once dirname( __file__ ) . ‘/install.php’; } if ( version_compare( get_option( ‘theme_prefix_version’ ), THEME_PREFIX_VERSION, … Read more