Add Tracks event for themes screen view (#40193)

* Add Tracks event for themes screen view

* Add changelog

* Use the load-themes.php hook
This commit is contained in:
Adrian Duffell 2023-09-18 15:19:34 +08:00 committed by GitHub
parent c661186499
commit 745dfe44a6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 0 deletions

View File

@ -0,0 +1,4 @@
Significance: minor
Type: add
Add Tracks events to Appearance > Themes screen

View File

@ -93,6 +93,8 @@ class Loader {
remove_action( 'admin_print_scripts', 'print_emoji_detection_script' );
add_action( 'admin_init', array( __CLASS__, 'deactivate_wc_admin_plugin' ) );
add_action( 'load-themes.php', array( __CLASS__, 'add_appearance_theme_view_tracks_event' ) );
}
/**
@ -571,4 +573,11 @@ class Loader {
delete_option( 'woocommerce_onboarding_homepage_post_id' );
}
}
/**
* Adds the appearance_theme_view Tracks event.
*/
public static function add_appearance_theme_view_tracks_event() {
wc_admin_record_tracks_event( 'appearance_theme_view', array() );
}
}