Skip to content

Commit

Permalink
Ensure plugin API functions are available
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremyfelt committed Aug 1, 2023
1 parent dce0fa4 commit 04c208b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,11 @@ function remove_my_sites_comments_menu() {
return;
}

// The plugin API is not always available on the front-end.
if ( ! function_exists( 'is_plugin_active_for_network' ) ) {
require_once ABSPATH . '/wp-admin/includes/plugin.php';
}

$network_active = is_plugin_active_for_network( plugin_basename( __FILE__ ) );

foreach ( $wp_admin_bar->user->blogs as $blog ) {
Expand Down

0 comments on commit 04c208b

Please sign in to comment.