Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions php/class-utils.php
Original file line number Diff line number Diff line change
Expand Up @@ -334,8 +334,17 @@ protected static function table_installed() {
* Install our custom table.
*/
public static function install() {
// Ensure that the plugin bootstrap is loaded.
get_plugin_instance()->init();
$plugin = get_plugin_instance();

// Ensure the plugin metadata (version, paths) is available for the DB
// routines below, but avoid re-running init during activation when it has
// already run on the `init` hook. Re-running the full bootstrap out of
// sequence during activation can destabilise plugin load order for the
// request (e.g. triggering other plugins such as ACF to initialise too
// early). We only need the plugin version here, not the component graph.
if ( empty( $plugin->version ) ) {
$plugin->init();
}

$sql = self::get_table_sql();

Expand Down
Loading