@automattic/newspack-blocks 4.18.0-alpha.2 → 4.18.0-alpha.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md
CHANGED
|
@@ -1,14 +1,16 @@
|
|
|
1
|
-
# [4.18.0-alpha.
|
|
1
|
+
# [4.18.0-alpha.3](https://github.com/Automattic/newspack-blocks/compare/v4.18.0-alpha.2...v4.18.0-alpha.3) (2025-11-18)
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
### Bug Fixes
|
|
5
5
|
|
|
6
|
-
*
|
|
6
|
+
* **modal-checkout:** check product type to get recurrence data ([#2259](https://github.com/Automattic/newspack-blocks/issues/2259)) ([0c2ed81](https://github.com/Automattic/newspack-blocks/commit/0c2ed81a0ec2f68ae1aff3eb98633ed52def3218))
|
|
7
7
|
|
|
8
|
+
## [4.17.5](https://github.com/Automattic/newspack-blocks/compare/v4.17.4...v4.17.5) (2025-11-18)
|
|
8
9
|
|
|
9
|
-
### Features
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* **modal-checkout:** check product type to get recurrence data ([#2259](https://github.com/Automattic/newspack-blocks/issues/2259)) ([0c2ed81](https://github.com/Automattic/newspack-blocks/commit/0c2ed81a0ec2f68ae1aff3eb98633ed52def3218))
|
|
12
14
|
|
|
13
15
|
## [4.17.4](https://github.com/Automattic/newspack-blocks/compare/v4.17.3...v4.17.4) (2025-11-13)
|
|
14
16
|
|
|
@@ -81,13 +81,21 @@ final class Checkout_Data {
|
|
|
81
81
|
* Returns whether a product is a one time purchase, or recurring and when.
|
|
82
82
|
*
|
|
83
83
|
* @param string $product_id Product's ID.
|
|
84
|
+
*
|
|
85
|
+
* @return string The purchase recurrence.
|
|
84
86
|
*/
|
|
85
87
|
public static function get_purchase_recurrence( $product_id ) {
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
88
|
+
if ( ! function_exists( 'wc_get_product' ) ) {
|
|
89
|
+
return 'once';
|
|
90
|
+
}
|
|
91
|
+
$product = \wc_get_product( $product_id );
|
|
92
|
+
if ( $product && ( $product->is_type( 'subscription' ) || $product->is_type( 'subscription_variation' ) ) ) {
|
|
93
|
+
$recurrence = get_post_meta( $product_id, '_subscription_period', true );
|
|
94
|
+
if ( ! empty( $recurrence ) ) {
|
|
95
|
+
return $recurrence;
|
|
96
|
+
}
|
|
89
97
|
}
|
|
90
|
-
return
|
|
98
|
+
return 'once';
|
|
91
99
|
}
|
|
92
100
|
|
|
93
101
|
/**
|
package/newspack-blocks.php
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* Author URI: https://newspack.com/
|
|
8
8
|
* Text Domain: newspack-blocks
|
|
9
9
|
* Domain Path: /languages
|
|
10
|
-
* Version: 4.18.0-alpha.
|
|
10
|
+
* Version: 4.18.0-alpha.3
|
|
11
11
|
*
|
|
12
12
|
* @package Newspack_Blocks
|
|
13
13
|
*/
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
define( 'NEWSPACK_BLOCKS__PLUGIN_FILE', __FILE__ );
|
|
16
16
|
define( 'NEWSPACK_BLOCKS__BLOCKS_DIRECTORY', 'dist/' );
|
|
17
17
|
define( 'NEWSPACK_BLOCKS__PLUGIN_DIR', plugin_dir_path( NEWSPACK_BLOCKS__PLUGIN_FILE ) );
|
|
18
|
-
define( 'NEWSPACK_BLOCKS__VERSION', '4.18.0-alpha.
|
|
18
|
+
define( 'NEWSPACK_BLOCKS__VERSION', '4.18.0-alpha.3' );
|
|
19
19
|
|
|
20
20
|
require_once NEWSPACK_BLOCKS__PLUGIN_DIR . 'includes/class-newspack-blocks.php';
|
|
21
21
|
require_once NEWSPACK_BLOCKS__PLUGIN_DIR . 'includes/class-newspack-blocks-api.php';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@automattic/newspack-blocks",
|
|
3
|
-
"version": "4.18.0-alpha.
|
|
3
|
+
"version": "4.18.0-alpha.3",
|
|
4
4
|
"author": "Automattic",
|
|
5
5
|
"description": "=== Newspack Blocks === Contributors: (this should be a list of wordpress.org userid's) Donate link: https://example.com/ Tags: comments, spam Requires at least: 4.5 Tested up to: 5.1.1 Stable tag: 0.1.0 License: GPLv2 or later License URI: https://www.gnu.org/licenses/gpl-2.0.html",
|
|
6
6
|
"repository": {
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
'name' => 'automattic/newspack-blocks',
|
|
4
4
|
'pretty_version' => 'dev-trunk',
|
|
5
5
|
'version' => 'dev-trunk',
|
|
6
|
-
'reference' => '
|
|
6
|
+
'reference' => '1ea6ccc8c40b1df7ab1c457199a45041eecaca2f',
|
|
7
7
|
'type' => 'wordpress-plugin',
|
|
8
8
|
'install_path' => __DIR__ . '/../../',
|
|
9
9
|
'aliases' => array(),
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
'automattic/newspack-blocks' => array(
|
|
14
14
|
'pretty_version' => 'dev-trunk',
|
|
15
15
|
'version' => 'dev-trunk',
|
|
16
|
-
'reference' => '
|
|
16
|
+
'reference' => '1ea6ccc8c40b1df7ab1c457199a45041eecaca2f',
|
|
17
17
|
'type' => 'wordpress-plugin',
|
|
18
18
|
'install_path' => __DIR__ . '/../../',
|
|
19
19
|
'aliases' => array(),
|