@automattic/newspack-blocks 4.33.1 → 4.33.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,10 @@
1
+ ## @automattic/newspack-blocks [4.33.2](https://github.com/Automattic/newspack-workspace/compare/newspack-blocks@4.33.1...newspack-blocks@4.33.2) (2026-09-26)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * skip Content Loop/Carousel render for REST revisions and autosaves ([26b84c9](https://github.com/Automattic/newspack-workspace/commit/26b84c9e2bbf0021a534c20984eb95b0b33aec43))
7
+
1
8
  ## @automattic/newspack-blocks [4.33.1](https://github.com/Automattic/newspack-workspace/compare/newspack-blocks@4.33.0...newspack-blocks@4.33.1) (2026-09-21)
2
9
 
3
10
 
@@ -28,6 +28,19 @@ class Newspack_Blocks {
28
28
  */
29
29
  private static $content_render_depth = 0;
30
30
 
31
+ /**
32
+ * Stack of routes for the REST requests currently being served, innermost
33
+ * last. Pushed on `rest_request_before_callbacks` and popped on
34
+ * `rest_request_after_callbacks`, which bracket the endpoint callback on every
35
+ * dispatch path (HTTP, `rest_do_request()`, batch, embeds, preload). Using a
36
+ * stack, rather than a single value cleared on `rest_post_dispatch`, keeps an
37
+ * in-process request from leaving its route set after it returns, and restores
38
+ * the outer route when a nested request completes.
39
+ *
40
+ * @var string[]
41
+ */
42
+ private static $rest_route_stack = [];
43
+
31
44
  /**
32
45
  * Add hooks and filters.
33
46
  */
@@ -42,6 +55,8 @@ class Newspack_Blocks {
42
55
  add_filter( 'the_content', [ __CLASS__, 'end_content_render_pass' ], PHP_INT_MAX );
43
56
  add_filter( 'body_class', [ __CLASS__, 'add_body_classes' ] );
44
57
  add_filter( 'admin_body_class', [ __CLASS__, 'add_body_classes' ] );
58
+ add_filter( 'rest_request_before_callbacks', [ __CLASS__, 'push_rest_route' ], 10, 3 );
59
+ add_filter( 'rest_request_after_callbacks', [ __CLASS__, 'pop_rest_route' ], 10, 3 );
45
60
 
46
61
  /**
47
62
  * Disable NextGEN's `C_NextGen_Shortcode_Manager`.
@@ -679,6 +694,61 @@ class Newspack_Blocks {
679
694
  return ! $is_front_end;
680
695
  }
681
696
 
697
+ /**
698
+ * Remember the route of the REST request whose callback is about to run.
699
+ *
700
+ * WordPress has no accessor for the request currently in flight, so track it
701
+ * around the endpoint callback. `rest_request_before_callbacks` fires on every
702
+ * dispatch path, including in-process `rest_do_request()` calls that never
703
+ * reach `rest_post_dispatch`, so pairing it with `rest_request_after_callbacks`
704
+ * keeps the route from leaking past the request. Passes the value through
705
+ * unchanged.
706
+ *
707
+ * @param mixed $response Callback result to be replaced, unused here.
708
+ * @param array $handler Matched route handler, unused here.
709
+ * @param WP_REST_Request $request The request being dispatched.
710
+ * @return mixed The unchanged $response.
711
+ */
712
+ public static function push_rest_route( $response, $handler, $request ) {
713
+ self::$rest_route_stack[] = $request->get_route();
714
+ return $response;
715
+ }
716
+
717
+ /**
718
+ * Forget the route once its callback has run, so it never leaks into later work
719
+ * in a long-running process. `rest_request_after_callbacks` fires even when the
720
+ * permission check or callback returned an error, so it always balances the
721
+ * matching `push_rest_route()`.
722
+ *
723
+ * @param mixed $response Callback result to be served, passed through.
724
+ * @param array $handler Matched route handler, unused here.
725
+ * @param WP_REST_Request $request The request that was dispatched, unused here.
726
+ * @return mixed The unchanged $response.
727
+ */
728
+ public static function pop_rest_route( $response, $handler, $request ) {
729
+ array_pop( self::$rest_route_stack );
730
+ return $response;
731
+ }
732
+
733
+ /**
734
+ * Whether the current render is happening while a revision or autosave is being
735
+ * prepared for the REST API.
736
+ *
737
+ * The revisions and autosaves endpoints render a revision's `content.rendered`
738
+ * through `the_content`, which runs every dynamic block's render callback. That
739
+ * output is never displayed, so a Content Loop or Carousel block can skip its
740
+ * query entirely, which matters on sites where the editor autosaves against a
741
+ * large post set. Checks the innermost in-flight route so a nested request is
742
+ * judged on its own endpoint, not an outer one.
743
+ *
744
+ * @return bool
745
+ */
746
+ public static function is_rest_revision_or_autosave_render() {
747
+ $route = end( self::$rest_route_stack );
748
+ return ! empty( $route )
749
+ && (bool) preg_match( '#/(?:revisions|autosaves)(?:/\d+)?$#', $route );
750
+ }
751
+
682
752
  /**
683
753
  * Forget which posts have been rendered so far, so the next Content Loop or
684
754
  * Carousel block starts deduplicating from scratch.
@@ -2,7 +2,7 @@ msgid ""
2
2
  msgstr ""
3
3
  "Project-Id-Version: Newspack Blocks\n"
4
4
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/newspack-blocks\n"
5
- "POT-Creation-Date: 2026-09-18T15:34:37+00:00\n"
5
+ "POT-Creation-Date: 2026-09-26T16:11:48+00:00\n"
6
6
  "PO-Revision-Date: 2024-08-30 08:45-0700\n"
7
7
  "Last-Translator: \n"
8
8
  "Language-Team: \n"
@@ -309,45 +309,45 @@ msgstr ""
309
309
  msgid "Newspack Subscribe"
310
310
  msgstr ""
311
311
 
312
- #: includes/class-newspack-blocks.php:1062
312
+ #: includes/class-newspack-blocks.php:1132
313
313
  msgid "Common"
314
314
  msgstr ""
315
315
 
316
316
  #. translators: separates last two sponsor names; needs a space on either side.
317
- #: includes/class-newspack-blocks.php:1163
317
+ #: includes/class-newspack-blocks.php:1233
318
318
  msgid " and "
319
319
  msgstr " und "
320
320
 
321
321
  #. translators: separates all but the last two sponsor names; needs a space at the end.
322
- #: includes/class-newspack-blocks.php:1166
322
+ #: includes/class-newspack-blocks.php:1236
323
323
  msgid ", "
324
324
  msgstr ""
325
325
 
326
- #: includes/class-newspack-blocks.php:1501
326
+ #: includes/class-newspack-blocks.php:1571
327
327
  msgid "Jetpack donations is disabled in favour of Newspack donations."
328
328
  msgstr ""
329
329
 
330
- #: includes/class-newspack-blocks.php:1534 dist/editor.js:30
330
+ #: includes/class-newspack-blocks.php:1604 dist/editor.js:30
331
331
  #: src/shared/js/utils.js:54
332
332
  msgid "Draft"
333
333
  msgstr ""
334
334
 
335
- #: includes/class-newspack-blocks.php:1535 dist/editor.js:30
335
+ #: includes/class-newspack-blocks.php:1605 dist/editor.js:30
336
336
  #: src/shared/js/utils.js:54
337
337
  msgid "Scheduled"
338
338
  msgstr ""
339
339
 
340
340
  #. Translators: %s is the %s is the frequency.
341
- #: includes/class-newspack-blocks.php:1733 dist/editor.js:52
341
+ #: includes/class-newspack-blocks.php:1803 dist/editor.js:52
342
342
  #, php-format
343
343
  msgid "per %s"
344
344
  msgstr ""
345
345
 
346
- #: includes/class-newspack-blocks.php:1764
346
+ #: includes/class-newspack-blocks.php:1834
347
347
  msgid " once"
348
348
  msgstr ""
349
349
 
350
- #: includes/class-newspack-blocks.php:1767
350
+ #: includes/class-newspack-blocks.php:1837
351
351
  msgid " per "
352
352
  msgstr ""
353
353
 
@@ -561,24 +561,24 @@ msgid "Centered"
561
561
  msgstr ""
562
562
 
563
563
  #. translators: %d: Slide number.
564
- #: src/blocks/carousel/view.php:237
564
+ #: src/blocks/carousel/view.php:243
565
565
  #, php-format
566
566
  msgid "Go to slide %d"
567
567
  msgstr "Gehe zu Bild %d"
568
568
 
569
- #: src/blocks/carousel/view.php:258
569
+ #: src/blocks/carousel/view.php:264
570
570
  msgid "Previous Slide"
571
571
  msgstr "Vorheriger Slide"
572
572
 
573
- #: src/blocks/carousel/view.php:259
573
+ #: src/blocks/carousel/view.php:265
574
574
  msgid "Next Slide"
575
575
  msgstr "Nächste Folie"
576
576
 
577
- #: src/blocks/carousel/view.php:303
577
+ #: src/blocks/carousel/view.php:309
578
578
  msgid "Pause Slideshow"
579
579
  msgstr "Diashow pausieren"
580
580
 
581
- #: src/blocks/carousel/view.php:304
581
+ #: src/blocks/carousel/view.php:310
582
582
  msgid "Play Slideshow"
583
583
  msgstr "Diashow abspielen"
584
584
 
@@ -634,20 +634,20 @@ msgstr "Spendenbetrag"
634
634
  msgid "Other"
635
635
  msgstr "Andere"
636
636
 
637
- #: src/blocks/homepage-articles/view.php:409 dist/editor.js:64
637
+ #: src/blocks/homepage-articles/view.php:415 dist/editor.js:64
638
638
  msgid "Load more posts"
639
639
  msgstr "Mehr Beiträge laden"
640
640
 
641
- #: src/blocks/homepage-articles/view.php:416
641
+ #: src/blocks/homepage-articles/view.php:422
642
642
  msgid "Something went wrong. Please refresh the page and/or try again."
643
643
  msgstr ""
644
644
 
645
- #: src/blocks/homepage-articles/view.php:491
645
+ #: src/blocks/homepage-articles/view.php:497
646
646
  msgctxt "post author"
647
647
  msgid "by"
648
648
  msgstr "von"
649
649
 
650
- #: src/blocks/homepage-articles/view.php:508
650
+ #: src/blocks/homepage-articles/view.php:514
651
651
  msgctxt "post author"
652
652
  msgid " and "
653
653
  msgstr " und "
@@ -2,7 +2,7 @@ msgid ""
2
2
  msgstr ""
3
3
  "Project-Id-Version: Newspack Blocks 1.0.0-alpha.20\n"
4
4
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/newspack-blocks\n"
5
- "POT-Creation-Date: 2026-09-18T15:34:37+00:00\n"
5
+ "POT-Creation-Date: 2026-09-26T16:11:48+00:00\n"
6
6
  "PO-Revision-Date: 2025-08-12T14:56:45+00:00\n"
7
7
  "Last-Translator: \n"
8
8
  "Language-Team: \n"
@@ -301,45 +301,45 @@ msgstr ""
301
301
  msgid "Newspack Subscribe"
302
302
  msgstr ""
303
303
 
304
- #: includes/class-newspack-blocks.php:1062
304
+ #: includes/class-newspack-blocks.php:1132
305
305
  msgid "Common"
306
306
  msgstr ""
307
307
 
308
308
  #. translators: separates last two sponsor names; needs a space on either side.
309
- #: includes/class-newspack-blocks.php:1163
309
+ #: includes/class-newspack-blocks.php:1233
310
310
  msgid " and "
311
311
  msgstr " y "
312
312
 
313
313
  #. translators: separates all but the last two sponsor names; needs a space at the end.
314
- #: includes/class-newspack-blocks.php:1166
314
+ #: includes/class-newspack-blocks.php:1236
315
315
  msgid ", "
316
316
  msgstr ""
317
317
 
318
- #: includes/class-newspack-blocks.php:1501
318
+ #: includes/class-newspack-blocks.php:1571
319
319
  msgid "Jetpack donations is disabled in favour of Newspack donations."
320
320
  msgstr ""
321
321
 
322
- #: includes/class-newspack-blocks.php:1534 dist/editor.js:30
322
+ #: includes/class-newspack-blocks.php:1604 dist/editor.js:30
323
323
  #: src/shared/js/utils.js:54
324
324
  msgid "Draft"
325
325
  msgstr ""
326
326
 
327
- #: includes/class-newspack-blocks.php:1535 dist/editor.js:30
327
+ #: includes/class-newspack-blocks.php:1605 dist/editor.js:30
328
328
  #: src/shared/js/utils.js:54
329
329
  msgid "Scheduled"
330
330
  msgstr ""
331
331
 
332
332
  #. Translators: %s is the %s is the frequency.
333
- #: includes/class-newspack-blocks.php:1733 dist/editor.js:52
333
+ #: includes/class-newspack-blocks.php:1803 dist/editor.js:52
334
334
  #, php-format
335
335
  msgid "per %s"
336
336
  msgstr ""
337
337
 
338
- #: includes/class-newspack-blocks.php:1764
338
+ #: includes/class-newspack-blocks.php:1834
339
339
  msgid " once"
340
340
  msgstr ""
341
341
 
342
- #: includes/class-newspack-blocks.php:1767
342
+ #: includes/class-newspack-blocks.php:1837
343
343
  msgid " per "
344
344
  msgstr ""
345
345
 
@@ -553,24 +553,24 @@ msgid "Centered"
553
553
  msgstr ""
554
554
 
555
555
  #. translators: %d: Slide number.
556
- #: src/blocks/carousel/view.php:237
556
+ #: src/blocks/carousel/view.php:243
557
557
  #, php-format
558
558
  msgid "Go to slide %d"
559
559
  msgstr ""
560
560
 
561
- #: src/blocks/carousel/view.php:258
561
+ #: src/blocks/carousel/view.php:264
562
562
  msgid "Previous Slide"
563
563
  msgstr ""
564
564
 
565
- #: src/blocks/carousel/view.php:259
565
+ #: src/blocks/carousel/view.php:265
566
566
  msgid "Next Slide"
567
567
  msgstr ""
568
568
 
569
- #: src/blocks/carousel/view.php:303
569
+ #: src/blocks/carousel/view.php:309
570
570
  msgid "Pause Slideshow"
571
571
  msgstr ""
572
572
 
573
- #: src/blocks/carousel/view.php:304
573
+ #: src/blocks/carousel/view.php:310
574
574
  msgid "Play Slideshow"
575
575
  msgstr ""
576
576
 
@@ -626,20 +626,20 @@ msgstr "Monto de la donación"
626
626
  msgid "Other"
627
627
  msgstr "Otro"
628
628
 
629
- #: src/blocks/homepage-articles/view.php:409 dist/editor.js:64
629
+ #: src/blocks/homepage-articles/view.php:415 dist/editor.js:64
630
630
  msgid "Load more posts"
631
631
  msgstr ""
632
632
 
633
- #: src/blocks/homepage-articles/view.php:416
633
+ #: src/blocks/homepage-articles/view.php:422
634
634
  msgid "Something went wrong. Please refresh the page and/or try again."
635
635
  msgstr ""
636
636
 
637
- #: src/blocks/homepage-articles/view.php:491
637
+ #: src/blocks/homepage-articles/view.php:497
638
638
  msgctxt "post author"
639
639
  msgid "by"
640
640
  msgstr "por"
641
641
 
642
- #: src/blocks/homepage-articles/view.php:508
642
+ #: src/blocks/homepage-articles/view.php:514
643
643
  msgctxt "post author"
644
644
  msgid " and "
645
645
  msgstr " y "
@@ -2,7 +2,7 @@ msgid ""
2
2
  msgstr ""
3
3
  "Project-Id-Version: Newspack Blocks 1.0.0-alpha.25\n"
4
4
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/newspack-blocks\n"
5
- "POT-Creation-Date: 2026-09-18T15:34:37+00:00\n"
5
+ "POT-Creation-Date: 2026-09-26T16:11:48+00:00\n"
6
6
  "PO-Revision-Date: 2024-08-30 08:46-0700\n"
7
7
  "Last-Translator: \n"
8
8
  "Language-Team: \n"
@@ -301,45 +301,45 @@ msgstr ""
301
301
  msgid "Newspack Subscribe"
302
302
  msgstr ""
303
303
 
304
- #: includes/class-newspack-blocks.php:1062
304
+ #: includes/class-newspack-blocks.php:1132
305
305
  msgid "Common"
306
306
  msgstr ""
307
307
 
308
308
  #. translators: separates last two sponsor names; needs a space on either side.
309
- #: includes/class-newspack-blocks.php:1163
309
+ #: includes/class-newspack-blocks.php:1233
310
310
  msgid " and "
311
311
  msgstr " et "
312
312
 
313
313
  #. translators: separates all but the last two sponsor names; needs a space at the end.
314
- #: includes/class-newspack-blocks.php:1166
314
+ #: includes/class-newspack-blocks.php:1236
315
315
  msgid ", "
316
316
  msgstr ""
317
317
 
318
- #: includes/class-newspack-blocks.php:1501
318
+ #: includes/class-newspack-blocks.php:1571
319
319
  msgid "Jetpack donations is disabled in favour of Newspack donations."
320
320
  msgstr ""
321
321
 
322
- #: includes/class-newspack-blocks.php:1534 dist/editor.js:30
322
+ #: includes/class-newspack-blocks.php:1604 dist/editor.js:30
323
323
  #: src/shared/js/utils.js:54
324
324
  msgid "Draft"
325
325
  msgstr ""
326
326
 
327
- #: includes/class-newspack-blocks.php:1535 dist/editor.js:30
327
+ #: includes/class-newspack-blocks.php:1605 dist/editor.js:30
328
328
  #: src/shared/js/utils.js:54
329
329
  msgid "Scheduled"
330
330
  msgstr ""
331
331
 
332
332
  #. Translators: %s is the %s is the frequency.
333
- #: includes/class-newspack-blocks.php:1733 dist/editor.js:52
333
+ #: includes/class-newspack-blocks.php:1803 dist/editor.js:52
334
334
  #, php-format
335
335
  msgid "per %s"
336
336
  msgstr ""
337
337
 
338
- #: includes/class-newspack-blocks.php:1764
338
+ #: includes/class-newspack-blocks.php:1834
339
339
  msgid " once"
340
340
  msgstr ""
341
341
 
342
- #: includes/class-newspack-blocks.php:1767
342
+ #: includes/class-newspack-blocks.php:1837
343
343
  msgid " per "
344
344
  msgstr ""
345
345
 
@@ -553,24 +553,24 @@ msgid "Centered"
553
553
  msgstr ""
554
554
 
555
555
  #. translators: %d: Slide number.
556
- #: src/blocks/carousel/view.php:237
556
+ #: src/blocks/carousel/view.php:243
557
557
  #, php-format
558
558
  msgid "Go to slide %d"
559
559
  msgstr "Allez à la diapositive %d"
560
560
 
561
- #: src/blocks/carousel/view.php:258
561
+ #: src/blocks/carousel/view.php:264
562
562
  msgid "Previous Slide"
563
563
  msgstr "Diapositive précédente"
564
564
 
565
- #: src/blocks/carousel/view.php:259
565
+ #: src/blocks/carousel/view.php:265
566
566
  msgid "Next Slide"
567
567
  msgstr "Diapositive suivante"
568
568
 
569
- #: src/blocks/carousel/view.php:303
569
+ #: src/blocks/carousel/view.php:309
570
570
  msgid "Pause Slideshow"
571
571
  msgstr "Mettre le diaporama en pause"
572
572
 
573
- #: src/blocks/carousel/view.php:304
573
+ #: src/blocks/carousel/view.php:310
574
574
  msgid "Play Slideshow"
575
575
  msgstr "Démarrer le diaporama"
576
576
 
@@ -626,21 +626,21 @@ msgstr "Montant du don"
626
626
  msgid "Other"
627
627
  msgstr "Autre"
628
628
 
629
- #: src/blocks/homepage-articles/view.php:409 dist/editor.js:64
629
+ #: src/blocks/homepage-articles/view.php:415 dist/editor.js:64
630
630
  msgid "Load more posts"
631
631
  msgstr "Charger plus d’articles"
632
632
 
633
- #: src/blocks/homepage-articles/view.php:416
633
+ #: src/blocks/homepage-articles/view.php:422
634
634
  msgid "Something went wrong. Please refresh the page and/or try again."
635
635
  msgstr ""
636
636
  "Un problème est survenu. Veuillez actualiser la page et / ou réessayer."
637
637
 
638
- #: src/blocks/homepage-articles/view.php:491
638
+ #: src/blocks/homepage-articles/view.php:497
639
639
  msgctxt "post author"
640
640
  msgid "by"
641
641
  msgstr "par"
642
642
 
643
- #: src/blocks/homepage-articles/view.php:508
643
+ #: src/blocks/homepage-articles/view.php:514
644
644
  msgctxt "post author"
645
645
  msgid " and "
646
646
  msgstr " et "
@@ -2,7 +2,7 @@ msgid ""
2
2
  msgstr ""
3
3
  "Project-Id-Version: Newspack Blocks 1.0.0-alpha.20\n"
4
4
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/newspack-blocks\n"
5
- "POT-Creation-Date: 2026-09-18T15:34:37+00:00\n"
5
+ "POT-Creation-Date: 2026-09-26T16:11:48+00:00\n"
6
6
  "PO-Revision-Date: 2024-08-30 08:46-0700\n"
7
7
  "Last-Translator: \n"
8
8
  "Language-Team: \n"
@@ -300,45 +300,45 @@ msgstr ""
300
300
  msgid "Newspack Subscribe"
301
301
  msgstr ""
302
302
 
303
- #: includes/class-newspack-blocks.php:1062
303
+ #: includes/class-newspack-blocks.php:1132
304
304
  msgid "Common"
305
305
  msgstr ""
306
306
 
307
307
  #. translators: separates last two sponsor names; needs a space on either side.
308
- #: includes/class-newspack-blocks.php:1163
308
+ #: includes/class-newspack-blocks.php:1233
309
309
  msgid " and "
310
310
  msgstr " og "
311
311
 
312
312
  #. translators: separates all but the last two sponsor names; needs a space at the end.
313
- #: includes/class-newspack-blocks.php:1166
313
+ #: includes/class-newspack-blocks.php:1236
314
314
  msgid ", "
315
315
  msgstr ""
316
316
 
317
- #: includes/class-newspack-blocks.php:1501
317
+ #: includes/class-newspack-blocks.php:1571
318
318
  msgid "Jetpack donations is disabled in favour of Newspack donations."
319
319
  msgstr ""
320
320
 
321
- #: includes/class-newspack-blocks.php:1534 dist/editor.js:30
321
+ #: includes/class-newspack-blocks.php:1604 dist/editor.js:30
322
322
  #: src/shared/js/utils.js:54
323
323
  msgid "Draft"
324
324
  msgstr ""
325
325
 
326
- #: includes/class-newspack-blocks.php:1535 dist/editor.js:30
326
+ #: includes/class-newspack-blocks.php:1605 dist/editor.js:30
327
327
  #: src/shared/js/utils.js:54
328
328
  msgid "Scheduled"
329
329
  msgstr ""
330
330
 
331
331
  #. Translators: %s is the %s is the frequency.
332
- #: includes/class-newspack-blocks.php:1733 dist/editor.js:52
332
+ #: includes/class-newspack-blocks.php:1803 dist/editor.js:52
333
333
  #, php-format
334
334
  msgid "per %s"
335
335
  msgstr ""
336
336
 
337
- #: includes/class-newspack-blocks.php:1764
337
+ #: includes/class-newspack-blocks.php:1834
338
338
  msgid " once"
339
339
  msgstr ""
340
340
 
341
- #: includes/class-newspack-blocks.php:1767
341
+ #: includes/class-newspack-blocks.php:1837
342
342
  msgid " per "
343
343
  msgstr ""
344
344
 
@@ -552,24 +552,24 @@ msgid "Centered"
552
552
  msgstr ""
553
553
 
554
554
  #. translators: %d: Slide number.
555
- #: src/blocks/carousel/view.php:237
555
+ #: src/blocks/carousel/view.php:243
556
556
  #, php-format
557
557
  msgid "Go to slide %d"
558
558
  msgstr ""
559
559
 
560
- #: src/blocks/carousel/view.php:258
560
+ #: src/blocks/carousel/view.php:264
561
561
  msgid "Previous Slide"
562
562
  msgstr ""
563
563
 
564
- #: src/blocks/carousel/view.php:259
564
+ #: src/blocks/carousel/view.php:265
565
565
  msgid "Next Slide"
566
566
  msgstr ""
567
567
 
568
- #: src/blocks/carousel/view.php:303
568
+ #: src/blocks/carousel/view.php:309
569
569
  msgid "Pause Slideshow"
570
570
  msgstr ""
571
571
 
572
- #: src/blocks/carousel/view.php:304
572
+ #: src/blocks/carousel/view.php:310
573
573
  msgid "Play Slideshow"
574
574
  msgstr ""
575
575
 
@@ -625,20 +625,20 @@ msgstr "Mengde donasjon"
625
625
  msgid "Other"
626
626
  msgstr "Annet"
627
627
 
628
- #: src/blocks/homepage-articles/view.php:409 dist/editor.js:64
628
+ #: src/blocks/homepage-articles/view.php:415 dist/editor.js:64
629
629
  msgid "Load more posts"
630
630
  msgstr "Last flere innlegg"
631
631
 
632
- #: src/blocks/homepage-articles/view.php:416
632
+ #: src/blocks/homepage-articles/view.php:422
633
633
  msgid "Something went wrong. Please refresh the page and/or try again."
634
634
  msgstr "Noe gikk galt. Oppdater siden og/eller prøv igjen."
635
635
 
636
- #: src/blocks/homepage-articles/view.php:491
636
+ #: src/blocks/homepage-articles/view.php:497
637
637
  msgctxt "post author"
638
638
  msgid "by"
639
639
  msgstr "av"
640
640
 
641
- #: src/blocks/homepage-articles/view.php:508
641
+ #: src/blocks/homepage-articles/view.php:514
642
642
  msgctxt "post author"
643
643
  msgid " and "
644
644
  msgstr " og "
@@ -2,7 +2,7 @@ msgid ""
2
2
  msgstr ""
3
3
  "Project-Id-Version: Newspack Blocks 1.0.0-alpha.25\n"
4
4
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/newspack-blocks\n"
5
- "POT-Creation-Date: 2026-09-18T15:34:37+00:00\n"
5
+ "POT-Creation-Date: 2026-09-26T16:11:48+00:00\n"
6
6
  "PO-Revision-Date: 2024-08-30 08:46-0700\n"
7
7
  "Last-Translator: \n"
8
8
  "Language-Team: \n"
@@ -299,45 +299,45 @@ msgstr ""
299
299
  msgid "Newspack Subscribe"
300
300
  msgstr ""
301
301
 
302
- #: includes/class-newspack-blocks.php:1062
302
+ #: includes/class-newspack-blocks.php:1132
303
303
  msgid "Common"
304
304
  msgstr ""
305
305
 
306
306
  #. translators: separates last two sponsor names; needs a space on either side.
307
- #: includes/class-newspack-blocks.php:1163
307
+ #: includes/class-newspack-blocks.php:1233
308
308
  msgid " and "
309
309
  msgstr " e "
310
310
 
311
311
  #. translators: separates all but the last two sponsor names; needs a space at the end.
312
- #: includes/class-newspack-blocks.php:1166
312
+ #: includes/class-newspack-blocks.php:1236
313
313
  msgid ", "
314
314
  msgstr ""
315
315
 
316
- #: includes/class-newspack-blocks.php:1501
316
+ #: includes/class-newspack-blocks.php:1571
317
317
  msgid "Jetpack donations is disabled in favour of Newspack donations."
318
318
  msgstr ""
319
319
 
320
- #: includes/class-newspack-blocks.php:1534 dist/editor.js:30
320
+ #: includes/class-newspack-blocks.php:1604 dist/editor.js:30
321
321
  #: src/shared/js/utils.js:54
322
322
  msgid "Draft"
323
323
  msgstr ""
324
324
 
325
- #: includes/class-newspack-blocks.php:1535 dist/editor.js:30
325
+ #: includes/class-newspack-blocks.php:1605 dist/editor.js:30
326
326
  #: src/shared/js/utils.js:54
327
327
  msgid "Scheduled"
328
328
  msgstr ""
329
329
 
330
330
  #. Translators: %s is the %s is the frequency.
331
- #: includes/class-newspack-blocks.php:1733 dist/editor.js:52
331
+ #: includes/class-newspack-blocks.php:1803 dist/editor.js:52
332
332
  #, php-format
333
333
  msgid "per %s"
334
334
  msgstr ""
335
335
 
336
- #: includes/class-newspack-blocks.php:1764
336
+ #: includes/class-newspack-blocks.php:1834
337
337
  msgid " once"
338
338
  msgstr ""
339
339
 
340
- #: includes/class-newspack-blocks.php:1767
340
+ #: includes/class-newspack-blocks.php:1837
341
341
  msgid " per "
342
342
  msgstr ""
343
343
 
@@ -551,24 +551,24 @@ msgid "Centered"
551
551
  msgstr ""
552
552
 
553
553
  #. translators: %d: Slide number.
554
- #: src/blocks/carousel/view.php:237
554
+ #: src/blocks/carousel/view.php:243
555
555
  #, php-format
556
556
  msgid "Go to slide %d"
557
557
  msgstr ""
558
558
 
559
- #: src/blocks/carousel/view.php:258
559
+ #: src/blocks/carousel/view.php:264
560
560
  msgid "Previous Slide"
561
561
  msgstr "Slide Anterior"
562
562
 
563
- #: src/blocks/carousel/view.php:259
563
+ #: src/blocks/carousel/view.php:265
564
564
  msgid "Next Slide"
565
565
  msgstr "Próximo Slide"
566
566
 
567
- #: src/blocks/carousel/view.php:303
567
+ #: src/blocks/carousel/view.php:309
568
568
  msgid "Pause Slideshow"
569
569
  msgstr "Pausa na apresentação"
570
570
 
571
- #: src/blocks/carousel/view.php:304
571
+ #: src/blocks/carousel/view.php:310
572
572
  msgid "Play Slideshow"
573
573
  msgstr ""
574
574
 
@@ -624,20 +624,20 @@ msgstr "Valor da Doação"
624
624
  msgid "Other"
625
625
  msgstr "Outro"
626
626
 
627
- #: src/blocks/homepage-articles/view.php:409 dist/editor.js:64
627
+ #: src/blocks/homepage-articles/view.php:415 dist/editor.js:64
628
628
  msgid "Load more posts"
629
629
  msgstr "Carregar mais posts"
630
630
 
631
- #: src/blocks/homepage-articles/view.php:416
631
+ #: src/blocks/homepage-articles/view.php:422
632
632
  msgid "Something went wrong. Please refresh the page and/or try again."
633
633
  msgstr ""
634
634
 
635
- #: src/blocks/homepage-articles/view.php:491
635
+ #: src/blocks/homepage-articles/view.php:497
636
636
  msgctxt "post author"
637
637
  msgid "by"
638
638
  msgstr "por"
639
639
 
640
- #: src/blocks/homepage-articles/view.php:508
640
+ #: src/blocks/homepage-articles/view.php:514
641
641
  msgctxt "post author"
642
642
  msgid " and "
643
643
  msgstr " e "
@@ -2,14 +2,14 @@
2
2
  # This file is distributed under the same license as the Newspack Blocks plugin.
3
3
  msgid ""
4
4
  msgstr ""
5
- "Project-Id-Version: Newspack Blocks 4.32.1\n"
5
+ "Project-Id-Version: Newspack Blocks 4.33.1\n"
6
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/newspack-blocks\n"
7
7
  "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
8
8
  "Language-Team: LANGUAGE <LL@li.org>\n"
9
9
  "MIME-Version: 1.0\n"
10
10
  "Content-Type: text/plain; charset=UTF-8\n"
11
11
  "Content-Transfer-Encoding: 8bit\n"
12
- "POT-Creation-Date: 2026-09-18T15:34:37+00:00\n"
12
+ "POT-Creation-Date: 2026-09-26T16:11:48+00:00\n"
13
13
  "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
14
14
  "X-Generator: WP-CLI 2.12.0\n"
15
15
  "X-Domain: newspack-blocks\n"
@@ -294,48 +294,48 @@ msgstr ""
294
294
  msgid "Newspack Subscribe"
295
295
  msgstr ""
296
296
 
297
- #: includes/class-newspack-blocks.php:1062
297
+ #: includes/class-newspack-blocks.php:1132
298
298
  msgid "Common"
299
299
  msgstr ""
300
300
 
301
301
  #. translators: separates last two sponsor names; needs a space on either side.
302
- #: includes/class-newspack-blocks.php:1163
302
+ #: includes/class-newspack-blocks.php:1233
303
303
  msgid " and "
304
304
  msgstr ""
305
305
 
306
306
  #. translators: separates all but the last two sponsor names; needs a space at the end.
307
- #: includes/class-newspack-blocks.php:1166
307
+ #: includes/class-newspack-blocks.php:1236
308
308
  msgid ", "
309
309
  msgstr ""
310
310
 
311
- #: includes/class-newspack-blocks.php:1501
311
+ #: includes/class-newspack-blocks.php:1571
312
312
  msgid "Jetpack donations is disabled in favour of Newspack donations."
313
313
  msgstr ""
314
314
 
315
- #: includes/class-newspack-blocks.php:1534
315
+ #: includes/class-newspack-blocks.php:1604
316
316
  #: dist/editor.js:30
317
317
  #: src/shared/js/utils.js:54
318
318
  msgid "Draft"
319
319
  msgstr ""
320
320
 
321
- #: includes/class-newspack-blocks.php:1535
321
+ #: includes/class-newspack-blocks.php:1605
322
322
  #: dist/editor.js:30
323
323
  #: src/shared/js/utils.js:54
324
324
  msgid "Scheduled"
325
325
  msgstr ""
326
326
 
327
327
  #. Translators: %s is the %s is the frequency.
328
- #: includes/class-newspack-blocks.php:1733
328
+ #: includes/class-newspack-blocks.php:1803
329
329
  #: dist/editor.js:52
330
330
  #, php-format,js-format
331
331
  msgid "per %s"
332
332
  msgstr ""
333
333
 
334
- #: includes/class-newspack-blocks.php:1764
334
+ #: includes/class-newspack-blocks.php:1834
335
335
  msgid " once"
336
336
  msgstr ""
337
337
 
338
- #: includes/class-newspack-blocks.php:1767
338
+ #: includes/class-newspack-blocks.php:1837
339
339
  msgid " per "
340
340
  msgstr ""
341
341
 
@@ -565,24 +565,24 @@ msgid "Centered"
565
565
  msgstr ""
566
566
 
567
567
  #. translators: %d: Slide number.
568
- #: src/blocks/carousel/view.php:237
568
+ #: src/blocks/carousel/view.php:243
569
569
  #, php-format
570
570
  msgid "Go to slide %d"
571
571
  msgstr ""
572
572
 
573
- #: src/blocks/carousel/view.php:258
573
+ #: src/blocks/carousel/view.php:264
574
574
  msgid "Previous Slide"
575
575
  msgstr ""
576
576
 
577
- #: src/blocks/carousel/view.php:259
577
+ #: src/blocks/carousel/view.php:265
578
578
  msgid "Next Slide"
579
579
  msgstr ""
580
580
 
581
- #: src/blocks/carousel/view.php:303
581
+ #: src/blocks/carousel/view.php:309
582
582
  msgid "Pause Slideshow"
583
583
  msgstr ""
584
584
 
585
- #: src/blocks/carousel/view.php:304
585
+ #: src/blocks/carousel/view.php:310
586
586
  msgid "Play Slideshow"
587
587
  msgstr ""
588
588
 
@@ -637,21 +637,21 @@ msgstr ""
637
637
  msgid "Other"
638
638
  msgstr ""
639
639
 
640
- #: src/blocks/homepage-articles/view.php:409
640
+ #: src/blocks/homepage-articles/view.php:415
641
641
  #: dist/editor.js:64
642
642
  msgid "Load more posts"
643
643
  msgstr ""
644
644
 
645
- #: src/blocks/homepage-articles/view.php:416
645
+ #: src/blocks/homepage-articles/view.php:422
646
646
  msgid "Something went wrong. Please refresh the page and/or try again."
647
647
  msgstr ""
648
648
 
649
- #: src/blocks/homepage-articles/view.php:491
649
+ #: src/blocks/homepage-articles/view.php:497
650
650
  msgctxt "post author"
651
651
  msgid "by"
652
652
  msgstr ""
653
653
 
654
- #: src/blocks/homepage-articles/view.php:508
654
+ #: src/blocks/homepage-articles/view.php:514
655
655
  msgctxt "post author"
656
656
  msgid " and "
657
657
  msgstr ""
@@ -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.33.1
10
+ * Version: 4.33.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.33.1' );
18
+ define( 'NEWSPACK_BLOCKS__VERSION', '4.33.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.33.1",
3
+ "version": "4.33.2",
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": {
@@ -19,6 +19,12 @@ function newspack_blocks_render_block_carousel( $attributes ) {
19
19
  return;
20
20
  }
21
21
 
22
+ // Skip the query when a revision or autosave is being prepared for the REST
23
+ // API: the output is never shown, and the query is costly on large sites.
24
+ if ( Newspack_Blocks::is_rest_revision_or_autosave_render() ) {
25
+ return '';
26
+ }
27
+
22
28
  static $newspack_blocks_carousel_id = 0;
23
29
  global $newspack_blocks_post_id;
24
30
 
@@ -256,6 +256,12 @@ function newspack_blocks_render_block_homepage_articles( $attributes ) {
256
256
  return;
257
257
  }
258
258
 
259
+ // Skip the query when a revision or autosave is being prepared for the REST
260
+ // API: the output is never shown, and the query is costly on large sites.
261
+ if ( Newspack_Blocks::is_rest_revision_or_autosave_render() ) {
262
+ return '';
263
+ }
264
+
259
265
  $block_name = apply_filters( 'newspack_blocks_block_name', 'newspack-blocks/homepage-articles' );
260
266
  $article_query = new WP_Query( Newspack_Blocks::build_articles_query( $attributes, $block_name ) );
261
267
  if ( ! $article_query->have_posts() ) {
@@ -3,7 +3,7 @@
3
3
  'name' => 'automattic/newspack-blocks',
4
4
  'pretty_version' => 'dev-main',
5
5
  'version' => 'dev-main',
6
- 'reference' => 'bb97d4c46864b3260f24b22690bb570eaf91e404',
6
+ 'reference' => '61635411a8da066e76232eed8f277cd636741e36',
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-main',
15
15
  'version' => 'dev-main',
16
- 'reference' => 'bb97d4c46864b3260f24b22690bb570eaf91e404',
16
+ 'reference' => '61635411a8da066e76232eed8f277cd636741e36',
17
17
  'type' => 'wordpress-plugin',
18
18
  'install_path' => __DIR__ . '/../../',
19
19
  'aliases' => array(),