diff --git a/changelog.txt b/changelog.txt index ef8cdfb..a9eaee5 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,5 +1,8 @@ == Changelog == += 1.6.3 - 15 January 2025 = +* Resolved Uninstall Notice: Updated `register_uninstall_hook` callback to use a static class method, addressing a WordPress notice introduced in version 3.1.0. + = 1.6.2 - 13 January 2025 = * Fixed uninstall process to prevent PHP fatal error by updating the `register_uninstall_hook` callback to use a valid instance method. diff --git a/readme.txt b/readme.txt index a01a70e..30829fb 100644 --- a/readme.txt +++ b/readme.txt @@ -72,6 +72,9 @@ SiteOrigin Premium includes access to our professional email support service, pe == Changelog == += 1.6.3 - 15 January 2025 = +* Resolved Uninstall Notice: Updated `register_uninstall_hook` callback to use a static class method, addressing a WordPress notice introduced in version 3.1.0. + = 1.6.2 - 13 January 2025 = * Fixed uninstall process to prevent PHP fatal error by updating the `register_uninstall_hook` callback to use a valid instance method. diff --git a/so-css.php b/so-css.php index 3d57a81..1379605 100644 --- a/so-css.php +++ b/so-css.php @@ -83,7 +83,7 @@ public function __construct() { } } - register_uninstall_hook( __FILE__, array( $this, 'uninstall' ) ); + register_uninstall_hook( __FILE__, array( 'SiteOrigin_CSS', 'uninstall' ) ); } /** @@ -1050,11 +1050,12 @@ public function version_check() { * * @return void */ - public function uninstall() { + public static function uninstall() { + $theme = basename( get_template_directory() ); delete_option( 'so_css_version' ); delete_option( 'so_css_editor_theme' ); delete_option( 'so_css_output_location' ); - delete_option( 'siteorigin_custom_css_revisions[' . $this->theme . ']' ); + delete_option( 'siteorigin_custom_css_revisions[' . $theme . ']' ); } }