From 3ca66e5ea1ecf390b5a1f820b6877a92ff0bccd4 Mon Sep 17 00:00:00 2001 From: Krystian Wojciechowski Date: Mon, 7 Aug 2023 12:23:33 +0200 Subject: [PATCH 1/3] refactor: remove v7 & v6 deprecated functions --- compat/src-deprecated/functions.php | 170 ---------------------------- 1 file changed, 170 deletions(-) diff --git a/compat/src-deprecated/functions.php b/compat/src-deprecated/functions.php index faa762b61..35b7ebb66 100644 --- a/compat/src-deprecated/functions.php +++ b/compat/src-deprecated/functions.php @@ -50,176 +50,6 @@ function notification_deprecated_class( $class, $version, $replacement = null ) } -/** - * Gets the plugin Runtime. - * - * @deprecated 7.0.0 New Notification static class should be used. - * @param string $property Optional property to get. - * @return object Runtime class instance - */ -function notification_runtime( $property = null ) { - _deprecated_function( __FUNCTION__, '7.0.0', '\Notification' ); - - if ( null !== $property ) { - return Notification::component( $property ); - } - - return Notification::runtime(); -} - -/** - * Checks if notification post has been just started - * - * @since 5.0.0 - * @deprecated 6.0.0 Changed name for consistency. - * @param mixed $post Post ID or WP_Post. - * @return boolean True if notification has been just started - */ -function notification_is_new_notification( $post ) { - _deprecated_function( __FUNCTION__, '6.0.0', 'notification_post_is_new' ); - return notification_post_is_new( $post ); -} - -/** - * Registers notification - * - * @deprecated 6.0.0 Changed name for consistency. - * @param Interfaces\Sendable $notification Carrier object. - * @return void - */ -function register_notification( Interfaces\Sendable $notification ) { - _deprecated_function( __FUNCTION__, '6.0.0', 'notification_register_carrier' ); - notification_register_carrier( $notification ); -} - -/** - * Gets all registered notifications - * - * @since 5.0.0 - * @deprecated 6.0.0 Changed name for consistency. - * @return array notifications - */ -function notification_get_notifications() { - _deprecated_function( __FUNCTION__, '6.0.0', 'notification_get_carriers' ); - return notification_get_carriers(); -} - -/** - * Gets single registered notification - * - * @deprecated 6.0.0 Changed name for consistency. - * @param string $notification_slug notification slug. - * @return mixed notification object or false - */ -function notification_get_single_notification( $notification_slug ) { - _deprecated_function( __FUNCTION__, '6.0.0', 'notification_get_carrier' ); - return notification_get_carrier( $notification_slug ); -} - -/** - * Registers trigger - * Uses notification/triggers filter - * - * @deprecated 6.0.0 Changed name for consistency. - * @param Interfaces\Triggerable $trigger trigger object. - * @return void - */ -function register_trigger( Interfaces\Triggerable $trigger ) { - _deprecated_function( __FUNCTION__, '6.0.0', 'notification_register_trigger' ); - notification_register_trigger( $trigger ); -} - -/** - * Gets single registered recipient for notification type - * - * @since 5.0.0 - * @deprecated 6.0.0 Changed name for consistency. - * @param string $carrier_slug Carrier slug. - * @param string $recipient_slug Recipient slug. - * @return mixed Recipient object or false - */ -function notification_get_single_recipient( $carrier_slug, $recipient_slug ) { - _deprecated_function( __FUNCTION__, '6.0.0', 'notification_get_recipient' ); - return notification_get_recipient( $carrier_slug, $recipient_slug ); -} - -/** - * Gets register recipients for notification type - * - * @since 5.0.0 - * @deprecated 6.0.0 Changed name for consistency. - * @param string $carrier_slug Carrier slug. - * @return array Recipients array - */ -function notification_get_notification_recipients( $carrier_slug ) { - _deprecated_function( __FUNCTION__, '6.0.0', 'notification_get_carrier_recipients' ); - return notification_get_carrier_recipients( $carrier_slug ); -} - -/** - * Gets single registered trigger - * - * @since 5.0.0 - * @deprecated 6.0.0 Changed name for consistency. - * @param string $trigger_slug trigger slug. - * @return mixed trigger object or false - */ -function notification_get_single_trigger( $trigger_slug ) { - _deprecated_function( __FUNCTION__, '6.0.0', 'notification_get_trigger' ); - return notification_get_trigger( $trigger_slug ); -} - -/** - * Registers recipient - * Uses notification/recipients filter - * - * @deprecated 6.0.0 Changed name for consistency. - * @param string $carrier_slug Carrier slug. - * @param Interfaces\Receivable $recipient Recipient object. - * @return void - */ -function register_recipient( $carrier_slug, Interfaces\Receivable $recipient ) { - _deprecated_function( __FUNCTION__, '6.0.0', 'notification_register_recipient' ); - notification_register_recipient( $carrier_slug, $recipient ); -} - -/** - * Adds handlers for doc hooks to an object - * - * @since 5.2.2 - * @deprecated 7.0.0 Use `the micropackage/dochooks` package. - * @param object $object Object to create the hooks. - * @return object - */ -function notification_add_doc_hooks( $object ) { - _deprecated_function( __FUNCTION__, '7.0.0' ); - return DocHooksHelper::hook( $object ); -} - -/** - * Checks if the DocHooks are enabled and working. - * - * @since 6.1.0 - * @deprecated 7.0.0 Use the `micropackage/dochooks` package. - * @return bool - */ -function notification_dochooks_enabled() { - _deprecated_function( __FUNCTION__, '7.0.0' ); - return DocHooksHelper::is_enabled(); -} - -/** - * Creates new View object. - * - * @since 6.0.0 - * @deprecated 7.0.0 Use Templates object. - * @return bool - */ -function notification_create_view() { - _deprecated_function( __FUNCTION__, '7.0.0' ); - return false; -} - /** * Gets cached value or cache object * From a5616aef45a1952d4d3ea5508a1c6dcffe8200b0 Mon Sep 17 00:00:00 2001 From: Krystian Wojciechowski Date: Mon, 7 Aug 2023 12:23:55 +0200 Subject: [PATCH 2/3] refactor: remove v7 & v6 deprecated classes --- .../src-deprecated/Abstracts/Notification.php | 26 ----------------- .../Defaults/Notification/Email.php | 28 ------------------ .../Defaults/Notification/Webhook.php | 29 ------------------- 3 files changed, 83 deletions(-) delete mode 100644 compat/src-deprecated/Abstracts/Notification.php delete mode 100644 compat/src-deprecated/Defaults/Notification/Email.php delete mode 100644 compat/src-deprecated/Defaults/Notification/Webhook.php diff --git a/compat/src-deprecated/Abstracts/Notification.php b/compat/src-deprecated/Abstracts/Notification.php deleted file mode 100644 index e71ccb9df..000000000 --- a/compat/src-deprecated/Abstracts/Notification.php +++ /dev/null @@ -1,26 +0,0 @@ - Date: Tue, 8 Aug 2023 16:17:43 +0200 Subject: [PATCH 3/3] chor: changelog --- readme.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/readme.txt b/readme.txt index 0ed4a442d..22e83ad93 100644 --- a/readme.txt +++ b/readme.txt @@ -304,6 +304,7 @@ Yes! We're offering a [custom plugin development](https://bracketspace.com/custo = [Next] = +* [Changed] Removed v6 & v7 deprecated functions * [Fixed] Shortcodes being uncorrectly stripped leaving closing "]" behind. * [Fixed] PHP 8.2 deprecations. * [Changed] Minimum required PHP version from 7.4.