diff --git a/custom-fields.php b/custom-fields.php index 773560c..c1bc98d 100644 --- a/custom-fields.php +++ b/custom-fields.php @@ -47,6 +47,8 @@ function wpify_custom_fields(): CustomFields { * Only runs when the standalone plugin is deactivated, * not when the library is used as a Composer dependency. */ -register_deactivation_hook( __FILE__, function() { - wp_clear_scheduled_hook( 'wpifycf_cleanup_temp_files' ); -} ); +if ( function_exists( 'register_deactivation_hook' ) ) { + register_deactivation_hook( __FILE__, function () { + wp_clear_scheduled_hook( 'wpifycf_cleanup_temp_files' ); + } ); +}