Plugin Directory

Changeset 2879673


Ignore:
Timestamp:
03/14/2023 09:50:26 AM (3 years ago)
Author:
tangibleinc
Message:

3.1.7

Location:
tangible-loops-and-logic
Files:
66 deleted
10 edited
168 copied

Legend:

Unmodified
Added
Removed
  • tangible-loops-and-logic/tags/3.1.7/readme.txt

    r2873814 r2879673  
    11=== Loops & Logic ===
    2 Stable tag: 3.1.5
     2Stable tag: 3.1.7
    33Requires at least: 6.0
    44Tested up to: 6.1
     
    151151
    152152== Changelog ==
     153
     154= 3.1.7 =
     155
     156Release Date: 2023-03-14
     157
     158- Gutenberg integration
     159  - Improve content filter logic to protect template HTML
     160    - Ensure it applies only when inside do_blocks before do_shortcode
     161    - Support block themes
     162  - Improve getting current post ID when inside builder
    153163
    154164= 3.1.5 =
  • tangible-loops-and-logic/tags/3.1.7/tangible-loops-and-logic.php

    r2873814 r2879673  
    44 * Plugin URI: https://loopsandlogic.com/
    55 * Description: A template system with content type loops and conditions.
    6  * Version: 3.1.5
     6 * Version: 3.1.7
    77 * Author: Team Tangible
    88 * Author URI: https://teamtangible.com
     
    1010 */
    1111
    12 define( 'TANGIBLE_LOOPS_AND_LOGIC_VERSION', '3.1.5' );
     12define( 'TANGIBLE_LOOPS_AND_LOGIC_VERSION', '3.1.7' );
    1313
    1414require_once __DIR__ . '/vendor/tangible/plugin-framework/index.php';
  • tangible-loops-and-logic/tags/3.1.7/vendor/autoload.php

    r2873814 r2879673  
    2323require_once __DIR__ . '/composer/autoload_real.php';
    2424
    25 return ComposerAutoloaderInita75c74d3feab6a8eb5a8eb63d4f3129c::getLoader();
     25return ComposerAutoloaderInit061b8c8c95a773c86c64590d0a77df12::getLoader();
  • tangible-loops-and-logic/tags/3.1.7/vendor/composer/autoload_real.php

    r2873814 r2879673  
    33// autoload_real.php @generated by Composer
    44
    5 class ComposerAutoloaderInita75c74d3feab6a8eb5a8eb63d4f3129c
     5class ComposerAutoloaderInit061b8c8c95a773c86c64590d0a77df12
    66{
    77    private static $loader;
     
    2323        }
    2424
    25         spl_autoload_register(array('ComposerAutoloaderInita75c74d3feab6a8eb5a8eb63d4f3129c', 'loadClassLoader'), true, true);
     25        spl_autoload_register(array('ComposerAutoloaderInit061b8c8c95a773c86c64590d0a77df12', 'loadClassLoader'), true, true);
    2626        self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
    27         spl_autoload_unregister(array('ComposerAutoloaderInita75c74d3feab6a8eb5a8eb63d4f3129c', 'loadClassLoader'));
     27        spl_autoload_unregister(array('ComposerAutoloaderInit061b8c8c95a773c86c64590d0a77df12', 'loadClassLoader'));
    2828
    2929        require __DIR__ . '/autoload_static.php';
    30         call_user_func(\Composer\Autoload\ComposerStaticInita75c74d3feab6a8eb5a8eb63d4f3129c::getInitializer($loader));
     30        call_user_func(\Composer\Autoload\ComposerStaticInit061b8c8c95a773c86c64590d0a77df12::getInitializer($loader));
    3131
    3232        $loader->register(true);
  • tangible-loops-and-logic/tags/3.1.7/vendor/composer/autoload_static.php

    r2873814 r2879673  
    55namespace Composer\Autoload;
    66
    7 class ComposerStaticInita75c74d3feab6a8eb5a8eb63d4f3129c
     7class ComposerStaticInit061b8c8c95a773c86c64590d0a77df12
    88{
    99    public static $classMap = array (
     
    1414    {
    1515        return \Closure::bind(function () use ($loader) {
    16             $loader->classMap = ComposerStaticInita75c74d3feab6a8eb5a8eb63d4f3129c::$classMap;
     16            $loader->classMap = ComposerStaticInit061b8c8c95a773c86c64590d0a77df12::$classMap;
    1717
    1818        }, null, ClassLoader::class);
  • tangible-loops-and-logic/tags/3.1.7/vendor/composer/installed.json

    r2873814 r2879673  
    2222                "type": "git",
    2323                "url": "git@bitbucket.org:/tangibleinc/template-system.git",
    24                 "reference": "e0e99e5b717d09a4fb67d50e953e35ce7f5ac8df"
     24                "reference": "d14841153b8432f2882c558cc92917bc661d031d"
    2525            },
    26             "time": "2023-03-02T15:46:55+00:00",
     26            "time": "2023-03-09T22:10:06+00:00",
    2727            "default-branch": true,
    2828            "type": "library",
  • tangible-loops-and-logic/tags/3.1.7/vendor/composer/installed.php

    r2873814 r2879673  
    3232            'pretty_version' => 'dev-main',
    3333            'version' => 'dev-main',
    34             'reference' => 'e0e99e5b717d09a4fb67d50e953e35ce7f5ac8df',
     34            'reference' => 'd14841153b8432f2882c558cc92917bc661d031d',
    3535            'type' => 'library',
    3636            'install_path' => __DIR__ . '/../tangible/template-system',
  • tangible-loops-and-logic/tags/3.1.7/vendor/tangible/template-system/docs/changelog.md

    r2873814 r2879673  
    11Versions correspond to plugin release of Loops & Logic and Tangible Blocks.
     2
     3# 3.1.7
     4
     5- Gutenberg integration
     6  - Improve getting current post ID when inside builder
     7  - Improve content filter logic to protect template HTML
     8    - Support block themes
     9    - Ensure it applies only when inside do_blocks before do_shortcode
    210
    311# 3.1.5
  • tangible-loops-and-logic/tags/3.1.7/vendor/tangible/template-system/system/index.php

    r2873814 r2879673  
    66
    77  // Remember to update the version - Expected format: YYYYMMDD
    8   public $version = '20230302';
     8  public $version = '20230309';
    99  public $url;
    1010  public $path;
  • tangible-loops-and-logic/tags/3.1.7/vendor/tangible/template-system/system/integrations/gutenberg/utils.php

    r2873814 r2879673  
    6767   * @see /loop/context/index.php
    6868   */
    69   if (!empty($attributes['current_post_id'])) {
     69  if ($plugin->is_inside_gutenberg_editor() && !empty($attributes['current_post_id'])) {
    7070    // Post ID passed from ./enqueue.php
    7171    $post = get_post( $attributes['current_post_id'] );
     
    8383  // Restore previous state to support nested block renders
    8484  array_pop( $plugin->gutenberg_block_render_states );
     85
    8586  $plugin->current_gutenberg_block_render_state = end(
    8687    $plugin->gutenberg_block_render_states
     
    115116 * Workaround to protect block HTML from Gutenberg
    116117 *
     118 * "Abandon all hope, ye who enter here."
     119 *
    117120 * Gutenberg applies content filters such as wptexturize and do_shortcode
    118121 * to the entire page after all blocks have been rendered, which can corrupt
    119  * valid HTML and JSON. The dummy shortcode [twrap] prevents do_shortcode
    120  * from processing its inner content.
    121  *
    122  * This workaround can be removed if/when Gutenberg provides an option for
     122 * valid HTML and JSON.
     123 *
     124 * The shortcode [twrap] prevents do_shortcode from processing its inner
     125 * content. In addition, all square brackets need to be escaped and restored
     126 * to protect them from do_shortcodes_in_html_tags that runs on HTML attributes.
     127 *
     128 * The problem is specifically in the following files where the post content is
     129 * processed by do_blocks() then do_shortcode().
     130 *
     131 * - /wp-includes/default-filters.php in the filter "the_content" and
     132 * "widget_block_content"
     133 * - /wp-includes/block-template.php in get_the_block_template_html()
     134 *
     135 * This workaround can be removed if Gutenberg provides a setting for
    123136 * register_block_type() to opt-out of these content filters.
    124137 *
     
    127140 */
    128141$plugin->wrap_gutenberg_block_html = function($content) use ($plugin) {
    129   /**
    130    * Only wrap once, when we're outside of all (possibly nested) block renders,
    131    * AND we're inside do_blocks() as a content filter before do_shortcode().
    132    */
     142
     143  // Only wrap once, when we're outside of all (possibly nested) block renders
    133144  if ( ! $plugin->is_inside_gutenberg_block_render()
    134     && $plugin->is_doing_content_filter_before_do_shortcode()
     145    && $plugin->should_apply_gutenberg_workaround()
    135146  ) {
    136     return '[twrap]'.$content.'[/twrap]';
     147    return '[twrap]'
     148      // These escape codes are from /wp-includes/shortcodes.php
     149      . str_replace(['[', ']'], ['[', ']'], $content)
     150      .'[/twrap]'
     151    ;
    137152  }
    138153
     
    140155};
    141156
    142 add_shortcode('twrap', function($atts, $content) {
    143   return $content;
     157add_shortcode('twrap', function($atts, $content) use ($plugin) {
     158  /**
     159   * In a block theme, the template HTML can go through do_shortcode *twice*.
     160   *
     161   * - In template-canvas.php, the entire page is generated with
     162   * get_the_block_template_html(), which runs do_blocks() then do_shortcode().
     163   *
     164   * - During do_blocks(), the block "core/post-content" applies the_content
     165   * filter, which has do_shortcode() hooked on it.
     166   *
     167   * In this case, we must wrap the content again.
     168   *
     169   * @see /wp-includes/template-canvas.php
     170   * @see /wp-includes/blocks/post-content.php
     171   */
     172  if ($plugin->is_doing_core_post_content_block
     173    && doing_filter('the_content')
     174  ) {
     175    return '[twrap]' . $content . '[/twrap]';
     176  }
     177
     178  return str_replace(['[', ']'], ['[', ']'], $content);
    144179});
    145180
     
    150185
    151186/**
    152  * Detect if we're inside do_blocks as a content filter before do_shortcode
    153  *
    154  * Used to determine if the Gutenberg workaround above is necessary.
    155  *
    156  * @see wp-includes/default-filters.php
    157  */
    158 $plugin->is_doing_content_filter_before_do_shortcode = function () {
     187 * Determine if the Gutenberg workaround above is necessary
     188 */
     189$plugin->should_apply_gutenberg_workaround = function () {
     190
     191  /**
     192   * Check if inside a block theme running get_the_block_template_html().
     193   * There is no action to detect this situation.
     194   *
     195   * @see /wp-includes/template-canvas.php
     196   * @see /wp-includes/block-template.php, locate_block_template()
     197   */
     198
     199  global $template;
     200
     201  $template_canvas_path = ABSPATH . WPINC . '/template-canvas.php';
     202
     203  if ($template===$template_canvas_path && !did_action('wp_head')) {
     204    return true;
     205  }
     206 
     207  /**
     208   * Check if inside a content filter running do_blocks before do_shortcode
     209   */
    159210
    160211  $is_doing_content_filter = doing_filter('the_content')
     
    174225  $last_filter = array_slice($wp_current_filter, -1);
    175226  $action = array_pop($last_filter);
    176  
     227
    177228  $priority = isset($wp_filter[ $action ])
    178229    ? $wp_filter[ $action ]->current_priority()
     
    180231  ;
    181232
    182   // do_blocks at 9, do_shortcode at 11
    183   return $priority < 11;
    184 };
     233  /**
     234   * Typically do_blocks is at 9 and do_shortcode at 11, but make sure to
     235   * avoid any false positives, for example, if a plugin re/moves them.
     236   */
     237
     238  $priority_of_do_blocks = has_filter( $action, 'do_blocks' );
     239  $priority_of_do_shortcode = has_filter( $action, 'do_shortcode' );
     240
     241  return $priority_of_do_blocks !== false
     242    && $priority === $priority_of_do_blocks
     243    && $priority_of_do_shortcode !== false
     244    && $priority < $priority_of_do_shortcode
     245  ;
     246};
     247
     248/**
     249 * Keep track of when we're inside "core/post-content" block
     250 */
     251
     252$plugin->is_doing_core_post_content_block = false;
     253
     254// @see wp-includes/blocks.php, render_block()
     255add_action('render_block_data', function($block) use ($plugin) {
     256  if ($block['blockName']==='core/post-content') {
     257    $plugin->is_doing_core_post_content_block = true;
     258  }
     259  return $block;
     260}, 10, 1);
     261
     262// @see wp-includes/class-wp-block.php, render()
     263add_action('render_block_core/post-content', function($content) use ($plugin) {
     264  // This hook runs after the block has been rendered
     265  $plugin->is_doing_core_post_content_block = false;
     266  return $content;
     267}, 10, 1);
  • tangible-loops-and-logic/trunk/readme.txt

    r2873814 r2879673  
    11=== Loops & Logic ===
    2 Stable tag: 3.1.5
     2Stable tag: 3.1.7
    33Requires at least: 6.0
    44Tested up to: 6.1
     
    151151
    152152== Changelog ==
     153
     154= 3.1.7 =
     155
     156Release Date: 2023-03-14
     157
     158- Gutenberg integration
     159  - Improve content filter logic to protect template HTML
     160    - Ensure it applies only when inside do_blocks before do_shortcode
     161    - Support block themes
     162  - Improve getting current post ID when inside builder
    153163
    154164= 3.1.5 =
  • tangible-loops-and-logic/trunk/tangible-loops-and-logic.php

    r2873814 r2879673  
    44 * Plugin URI: https://loopsandlogic.com/
    55 * Description: A template system with content type loops and conditions.
    6  * Version: 3.1.5
     6 * Version: 3.1.7
    77 * Author: Team Tangible
    88 * Author URI: https://teamtangible.com
     
    1010 */
    1111
    12 define( 'TANGIBLE_LOOPS_AND_LOGIC_VERSION', '3.1.5' );
     12define( 'TANGIBLE_LOOPS_AND_LOGIC_VERSION', '3.1.7' );
    1313
    1414require_once __DIR__ . '/vendor/tangible/plugin-framework/index.php';
  • tangible-loops-and-logic/trunk/vendor/autoload.php

    r2873814 r2879673  
    2323require_once __DIR__ . '/composer/autoload_real.php';
    2424
    25 return ComposerAutoloaderInita75c74d3feab6a8eb5a8eb63d4f3129c::getLoader();
     25return ComposerAutoloaderInit061b8c8c95a773c86c64590d0a77df12::getLoader();
  • tangible-loops-and-logic/trunk/vendor/composer/autoload_real.php

    r2873814 r2879673  
    33// autoload_real.php @generated by Composer
    44
    5 class ComposerAutoloaderInita75c74d3feab6a8eb5a8eb63d4f3129c
     5class ComposerAutoloaderInit061b8c8c95a773c86c64590d0a77df12
    66{
    77    private static $loader;
     
    2323        }
    2424
    25         spl_autoload_register(array('ComposerAutoloaderInita75c74d3feab6a8eb5a8eb63d4f3129c', 'loadClassLoader'), true, true);
     25        spl_autoload_register(array('ComposerAutoloaderInit061b8c8c95a773c86c64590d0a77df12', 'loadClassLoader'), true, true);
    2626        self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
    27         spl_autoload_unregister(array('ComposerAutoloaderInita75c74d3feab6a8eb5a8eb63d4f3129c', 'loadClassLoader'));
     27        spl_autoload_unregister(array('ComposerAutoloaderInit061b8c8c95a773c86c64590d0a77df12', 'loadClassLoader'));
    2828
    2929        require __DIR__ . '/autoload_static.php';
    30         call_user_func(\Composer\Autoload\ComposerStaticInita75c74d3feab6a8eb5a8eb63d4f3129c::getInitializer($loader));
     30        call_user_func(\Composer\Autoload\ComposerStaticInit061b8c8c95a773c86c64590d0a77df12::getInitializer($loader));
    3131
    3232        $loader->register(true);
  • tangible-loops-and-logic/trunk/vendor/composer/autoload_static.php

    r2873814 r2879673  
    55namespace Composer\Autoload;
    66
    7 class ComposerStaticInita75c74d3feab6a8eb5a8eb63d4f3129c
     7class ComposerStaticInit061b8c8c95a773c86c64590d0a77df12
    88{
    99    public static $classMap = array (
     
    1414    {
    1515        return \Closure::bind(function () use ($loader) {
    16             $loader->classMap = ComposerStaticInita75c74d3feab6a8eb5a8eb63d4f3129c::$classMap;
     16            $loader->classMap = ComposerStaticInit061b8c8c95a773c86c64590d0a77df12::$classMap;
    1717
    1818        }, null, ClassLoader::class);
  • tangible-loops-and-logic/trunk/vendor/composer/installed.json

    r2873814 r2879673  
    2222                "type": "git",
    2323                "url": "git@bitbucket.org:/tangibleinc/template-system.git",
    24                 "reference": "e0e99e5b717d09a4fb67d50e953e35ce7f5ac8df"
     24                "reference": "d14841153b8432f2882c558cc92917bc661d031d"
    2525            },
    26             "time": "2023-03-02T15:46:55+00:00",
     26            "time": "2023-03-09T22:10:06+00:00",
    2727            "default-branch": true,
    2828            "type": "library",
  • tangible-loops-and-logic/trunk/vendor/composer/installed.php

    r2873814 r2879673  
    3232            'pretty_version' => 'dev-main',
    3333            'version' => 'dev-main',
    34             'reference' => 'e0e99e5b717d09a4fb67d50e953e35ce7f5ac8df',
     34            'reference' => 'd14841153b8432f2882c558cc92917bc661d031d',
    3535            'type' => 'library',
    3636            'install_path' => __DIR__ . '/../tangible/template-system',
  • tangible-loops-and-logic/trunk/vendor/tangible/template-system/docs/changelog.md

    r2873814 r2879673  
    11Versions correspond to plugin release of Loops & Logic and Tangible Blocks.
     2
     3# 3.1.7
     4
     5- Gutenberg integration
     6  - Improve getting current post ID when inside builder
     7  - Improve content filter logic to protect template HTML
     8    - Support block themes
     9    - Ensure it applies only when inside do_blocks before do_shortcode
    210
    311# 3.1.5
  • tangible-loops-and-logic/trunk/vendor/tangible/template-system/system/index.php

    r2873814 r2879673  
    66
    77  // Remember to update the version - Expected format: YYYYMMDD
    8   public $version = '20230302';
     8  public $version = '20230309';
    99  public $url;
    1010  public $path;
  • tangible-loops-and-logic/trunk/vendor/tangible/template-system/system/integrations/gutenberg/utils.php

    r2873814 r2879673  
    6767   * @see /loop/context/index.php
    6868   */
    69   if (!empty($attributes['current_post_id'])) {
     69  if ($plugin->is_inside_gutenberg_editor() && !empty($attributes['current_post_id'])) {
    7070    // Post ID passed from ./enqueue.php
    7171    $post = get_post( $attributes['current_post_id'] );
     
    8383  // Restore previous state to support nested block renders
    8484  array_pop( $plugin->gutenberg_block_render_states );
     85
    8586  $plugin->current_gutenberg_block_render_state = end(
    8687    $plugin->gutenberg_block_render_states
     
    115116 * Workaround to protect block HTML from Gutenberg
    116117 *
     118 * "Abandon all hope, ye who enter here."
     119 *
    117120 * Gutenberg applies content filters such as wptexturize and do_shortcode
    118121 * to the entire page after all blocks have been rendered, which can corrupt
    119  * valid HTML and JSON. The dummy shortcode [twrap] prevents do_shortcode
    120  * from processing its inner content.
    121  *
    122  * This workaround can be removed if/when Gutenberg provides an option for
     122 * valid HTML and JSON.
     123 *
     124 * The shortcode [twrap] prevents do_shortcode from processing its inner
     125 * content. In addition, all square brackets need to be escaped and restored
     126 * to protect them from do_shortcodes_in_html_tags that runs on HTML attributes.
     127 *
     128 * The problem is specifically in the following files where the post content is
     129 * processed by do_blocks() then do_shortcode().
     130 *
     131 * - /wp-includes/default-filters.php in the filter "the_content" and
     132 * "widget_block_content"
     133 * - /wp-includes/block-template.php in get_the_block_template_html()
     134 *
     135 * This workaround can be removed if Gutenberg provides a setting for
    123136 * register_block_type() to opt-out of these content filters.
    124137 *
     
    127140 */
    128141$plugin->wrap_gutenberg_block_html = function($content) use ($plugin) {
    129   /**
    130    * Only wrap once, when we're outside of all (possibly nested) block renders,
    131    * AND we're inside do_blocks() as a content filter before do_shortcode().
    132    */
     142
     143  // Only wrap once, when we're outside of all (possibly nested) block renders
    133144  if ( ! $plugin->is_inside_gutenberg_block_render()
    134     && $plugin->is_doing_content_filter_before_do_shortcode()
     145    && $plugin->should_apply_gutenberg_workaround()
    135146  ) {
    136     return '[twrap]'.$content.'[/twrap]';
     147    return '[twrap]'
     148      // These escape codes are from /wp-includes/shortcodes.php
     149      . str_replace(['[', ']'], ['&#091;', '&#093;'], $content)
     150      .'[/twrap]'
     151    ;
    137152  }
    138153
     
    140155};
    141156
    142 add_shortcode('twrap', function($atts, $content) {
    143   return $content;
     157add_shortcode('twrap', function($atts, $content) use ($plugin) {
     158  /**
     159   * In a block theme, the template HTML can go through do_shortcode *twice*.
     160   *
     161   * - In template-canvas.php, the entire page is generated with
     162   * get_the_block_template_html(), which runs do_blocks() then do_shortcode().
     163   *
     164   * - During do_blocks(), the block "core/post-content" applies the_content
     165   * filter, which has do_shortcode() hooked on it.
     166   *
     167   * In this case, we must wrap the content again.
     168   *
     169   * @see /wp-includes/template-canvas.php
     170   * @see /wp-includes/blocks/post-content.php
     171   */
     172  if ($plugin->is_doing_core_post_content_block
     173    && doing_filter('the_content')
     174  ) {
     175    return '[twrap]' . $content . '[/twrap]';
     176  }
     177
     178  return str_replace(['&#091;', '&#093;'], ['[', ']'], $content);
    144179});
    145180
     
    150185
    151186/**
    152  * Detect if we're inside do_blocks as a content filter before do_shortcode
    153  *
    154  * Used to determine if the Gutenberg workaround above is necessary.
    155  *
    156  * @see wp-includes/default-filters.php
    157  */
    158 $plugin->is_doing_content_filter_before_do_shortcode = function () {
     187 * Determine if the Gutenberg workaround above is necessary
     188 */
     189$plugin->should_apply_gutenberg_workaround = function () {
     190
     191  /**
     192   * Check if inside a block theme running get_the_block_template_html().
     193   * There is no action to detect this situation.
     194   *
     195   * @see /wp-includes/template-canvas.php
     196   * @see /wp-includes/block-template.php, locate_block_template()
     197   */
     198
     199  global $template;
     200
     201  $template_canvas_path = ABSPATH . WPINC . '/template-canvas.php';
     202
     203  if ($template===$template_canvas_path && !did_action('wp_head')) {
     204    return true;
     205  }
     206 
     207  /**
     208   * Check if inside a content filter running do_blocks before do_shortcode
     209   */
    159210
    160211  $is_doing_content_filter = doing_filter('the_content')
     
    174225  $last_filter = array_slice($wp_current_filter, -1);
    175226  $action = array_pop($last_filter);
    176  
     227
    177228  $priority = isset($wp_filter[ $action ])
    178229    ? $wp_filter[ $action ]->current_priority()
     
    180231  ;
    181232
    182   // do_blocks at 9, do_shortcode at 11
    183   return $priority < 11;
    184 };
     233  /**
     234   * Typically do_blocks is at 9 and do_shortcode at 11, but make sure to
     235   * avoid any false positives, for example, if a plugin re/moves them.
     236   */
     237
     238  $priority_of_do_blocks = has_filter( $action, 'do_blocks' );
     239  $priority_of_do_shortcode = has_filter( $action, 'do_shortcode' );
     240
     241  return $priority_of_do_blocks !== false
     242    && $priority === $priority_of_do_blocks
     243    && $priority_of_do_shortcode !== false
     244    && $priority < $priority_of_do_shortcode
     245  ;
     246};
     247
     248/**
     249 * Keep track of when we're inside "core/post-content" block
     250 */
     251
     252$plugin->is_doing_core_post_content_block = false;
     253
     254// @see wp-includes/blocks.php, render_block()
     255add_action('render_block_data', function($block) use ($plugin) {
     256  if ($block['blockName']==='core/post-content') {
     257    $plugin->is_doing_core_post_content_block = true;
     258  }
     259  return $block;
     260}, 10, 1);
     261
     262// @see wp-includes/class-wp-block.php, render()
     263add_action('render_block_core/post-content', function($content) use ($plugin) {
     264  // This hook runs after the block has been rendered
     265  $plugin->is_doing_core_post_content_block = false;
     266  return $content;
     267}, 10, 1);
Note: See TracChangeset for help on using the changeset viewer.