Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Only load admin integration when in admin.
  • Loading branch information
felixarntz committed Dec 2, 2021
commit ebf8624eda0f7eba9e9ce933440ae7bd2dad8e17
5 changes: 4 additions & 1 deletion load.php
Original file line number Diff line number Diff line change
Expand Up @@ -118,4 +118,7 @@ function perflab_load_active_modules() {

perflab_load_active_modules();

require_once plugin_dir_path( __FILE__ ) . 'admin/load.php';
// Only load admin integration when in admin.
if ( is_admin() ) {
require_once plugin_dir_path( __FILE__ ) . 'admin/load.php';
}
9 changes: 9 additions & 0 deletions tests/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,14 @@
'active_plugins' => array( basename( TESTS_PLUGIN_DIR ) . '/load.php' ),
);

// Add filter to ensure the plugin's admin integration is loaded for tests although not in admin.
require_once $_test_root . '/includes/functions.php';
tests_add_filter(
'plugins_loaded',
function() {
require_once TESTS_PLUGIN_DIR . '/admin/load.php';
}
);

// Start up the WP testing environment.
require $_test_root . '/includes/bootstrap.php';