Skip to content

Commit

Permalink
Fix - TGM Plugin activation calling undefined function wc_get_screen_…
Browse files Browse the repository at this point in the history
…ids (#44114)

Fixes an edge case where `WC_Admin_Notices::add_notices()` can be called, but the `wc_get_screen_ids()` function has not yet been defined.
  • Loading branch information
shivapoudel committed Feb 17, 2024
1 parent 4e6476a commit a14c59b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
4 changes: 4 additions & 0 deletions plugins/woocommerce/changelog/44114-patch-1
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: minor
Type: fix

Ensure WC admin functions are defined before attempting to add notices.
2 changes: 2 additions & 0 deletions plugins/woocommerce/includes/admin/class-wc-admin-notices.php
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,8 @@ public static function add_notices() {
return;
}

require_once WC_ABSPATH . 'includes/admin/wc-admin-functions.php';

$screen = get_current_screen();
$screen_id = $screen ? $screen->id : '';
$show_on_screens = array(
Expand Down

0 comments on commit a14c59b

Please sign in to comment.