@automattic/newspack-blocks 4.10.0 → 4.10.2

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,3 +1,17 @@
1
+ ## [4.10.2](https://github.com/Automattic/newspack-blocks/compare/v4.10.1...v4.10.2) (2025-04-24)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * add the timezone to the Content Loop datetime attribute ([#2113](https://github.com/Automattic/newspack-blocks/issues/2113)) ([6fbd004](https://github.com/Automattic/newspack-blocks/commit/6fbd0044bd7b5822d464bd569cc4941df5d81e19))
7
+
8
+ ## [4.10.1](https://github.com/Automattic/newspack-blocks/compare/v4.10.0...v4.10.1) (2025-04-21)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * **recaptcha:** move clone button code to Newspack\Recaptcha class ([#2111](https://github.com/Automattic/newspack-blocks/issues/2111)) ([a7bcdbd](https://github.com/Automattic/newspack-blocks/commit/a7bcdbd221b19fdbc4d565b0233d1b6de954c1b0))
14
+
1
15
  # [4.10.0](https://github.com/Automattic/newspack-blocks/compare/v4.9.2...v4.10.0) (2025-04-14)
2
16
 
3
17
 
@@ -1945,23 +1945,17 @@ final class Modal_Checkout {
1945
1945
  * Add newspack ui classes to the "Place order" button html.
1946
1946
  *
1947
1947
  * @param string $html The button html.
1948
+ *
1949
+ * @return string The modified button html.
1948
1950
  */
1949
1951
  public static function order_button_html( $html ) {
1950
1952
  if ( ! self::is_modal_checkout() ) {
1951
1953
  return $html;
1952
1954
  }
1953
1955
 
1954
- $class_prefix = self::get_class_prefix();
1955
-
1956
+ $class_prefix = self::get_class_prefix();
1956
1957
  $newspack_ui_html = preg_replace( '/class=".*?"/', "class='{$class_prefix}__button {$class_prefix}__button--primary {$class_prefix}__button--wide'", $html );
1957
1958
 
1958
- if ( class_exists( 'Newspack\Recaptcha' ) && \Newspack\Recaptcha::can_use_captcha( 'v2' ) ) {
1959
- $cloned_button = preg_replace( '/type="submit"/', 'type="button"', $newspack_ui_html );
1960
- $cloned_button = preg_replace( '/id="place_order"/', '', $newspack_ui_html );
1961
- $cloned_button = preg_replace( '/name=".*?"/', 'id="place_order_clone"', $newspack_ui_html );
1962
- $newspack_ui_html = $cloned_button . $newspack_ui_html;
1963
- }
1964
-
1965
1959
  return $newspack_ui_html;
1966
1960
  }
1967
1961
 
@@ -1389,6 +1389,24 @@ class Newspack_Blocks {
1389
1389
  return apply_filters( 'newspack_blocks_displayed_post_date', mysql_to_rfc3339( $post->post_date ), $post );
1390
1390
  }
1391
1391
 
1392
+ /**
1393
+ * Get post date in ISO-8601 format to be used in the datetime attribute.
1394
+ *
1395
+ * @param WP_Post $post Post object.
1396
+ * @return string Date string in ISO-8601 format.
1397
+ */
1398
+ public static function get_datetime_post_date( $post = null ) {
1399
+ if ( $post === null ) {
1400
+ $post = get_post();
1401
+ }
1402
+ /**
1403
+ * Filters the post date used for the datetime attribute.
1404
+ *
1405
+ * @param string Date string in a format appropriate for datetime attributes.
1406
+ */
1407
+ return apply_filters( 'newspack_blocks_displayed_post_date', get_post_datetime( $post )->format( 'c' ), $post );
1408
+ }
1409
+
1392
1410
  /**
1393
1411
  * Get post date to be displayed, formatted.
1394
1412
  *
@@ -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.10.0
10
+ * Version: 4.10.2
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.10.0' );
18
+ define( 'NEWSPACK_BLOCKS__VERSION', '4.10.2' );
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.10.0",
3
+ "version": "4.10.2",
4
4
  "author": "Automattic",
5
5
  "devDependencies": {
6
6
  "@rushstack/eslint-patch": "^1.11.0",
@@ -238,7 +238,7 @@ call_user_func(
238
238
  ),
239
239
  )
240
240
  ),
241
- esc_attr( Newspack_Blocks::get_displayed_post_date() ),
241
+ esc_attr( Newspack_Blocks::get_datetime_post_date() ),
242
242
  esc_html( Newspack_Blocks::get_formatted_displayed_post_date() ),
243
243
  esc_attr( get_the_modified_date( DATE_W3C ) ),
244
244
  esc_html( get_the_modified_date() )
@@ -22,4 +22,4 @@ if (PHP_VERSION_ID < 50600) {
22
22
 
23
23
  require_once __DIR__ . '/composer/autoload_real.php';
24
24
 
25
- return ComposerAutoloaderInitd2aee4cb19ae5baca1e6ddff2ac4d14f::getLoader();
25
+ return ComposerAutoloaderInit18b08f8761da351e6c24ced930834b0f::getLoader();
@@ -2,7 +2,7 @@
2
2
 
3
3
  // autoload_real.php @generated by Composer
4
4
 
5
- class ComposerAutoloaderInitd2aee4cb19ae5baca1e6ddff2ac4d14f
5
+ class ComposerAutoloaderInit18b08f8761da351e6c24ced930834b0f
6
6
  {
7
7
  private static $loader;
8
8
 
@@ -22,12 +22,12 @@ class ComposerAutoloaderInitd2aee4cb19ae5baca1e6ddff2ac4d14f
22
22
  return self::$loader;
23
23
  }
24
24
 
25
- spl_autoload_register(array('ComposerAutoloaderInitd2aee4cb19ae5baca1e6ddff2ac4d14f', 'loadClassLoader'), true, true);
25
+ spl_autoload_register(array('ComposerAutoloaderInit18b08f8761da351e6c24ced930834b0f', 'loadClassLoader'), true, true);
26
26
  self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
27
- spl_autoload_unregister(array('ComposerAutoloaderInitd2aee4cb19ae5baca1e6ddff2ac4d14f', 'loadClassLoader'));
27
+ spl_autoload_unregister(array('ComposerAutoloaderInit18b08f8761da351e6c24ced930834b0f', 'loadClassLoader'));
28
28
 
29
29
  require __DIR__ . '/autoload_static.php';
30
- call_user_func(\Composer\Autoload\ComposerStaticInitd2aee4cb19ae5baca1e6ddff2ac4d14f::getInitializer($loader));
30
+ call_user_func(\Composer\Autoload\ComposerStaticInit18b08f8761da351e6c24ced930834b0f::getInitializer($loader));
31
31
 
32
32
  $loader->register(true);
33
33
 
@@ -4,7 +4,7 @@
4
4
 
5
5
  namespace Composer\Autoload;
6
6
 
7
- class ComposerStaticInitd2aee4cb19ae5baca1e6ddff2ac4d14f
7
+ class ComposerStaticInit18b08f8761da351e6c24ced930834b0f
8
8
  {
9
9
  public static $classMap = array (
10
10
  'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php',
@@ -13,7 +13,7 @@ class ComposerStaticInitd2aee4cb19ae5baca1e6ddff2ac4d14f
13
13
  public static function getInitializer(ClassLoader $loader)
14
14
  {
15
15
  return \Closure::bind(function () use ($loader) {
16
- $loader->classMap = ComposerStaticInitd2aee4cb19ae5baca1e6ddff2ac4d14f::$classMap;
16
+ $loader->classMap = ComposerStaticInit18b08f8761da351e6c24ced930834b0f::$classMap;
17
17
 
18
18
  }, null, ClassLoader::class);
19
19
  }
@@ -3,7 +3,7 @@
3
3
  'name' => 'automattic/newspack-blocks',
4
4
  'pretty_version' => 'dev-trunk',
5
5
  'version' => 'dev-trunk',
6
- 'reference' => '149f9607676726ff5a290161a63fbb792302add2',
6
+ 'reference' => '6fbd0044bd7b5822d464bd569cc4941df5d81e19',
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' => '149f9607676726ff5a290161a63fbb792302add2',
16
+ 'reference' => '6fbd0044bd7b5822d464bd569cc4941df5d81e19',
17
17
  'type' => 'wordpress-plugin',
18
18
  'install_path' => __DIR__ . '/../../',
19
19
  'aliases' => array(),