• Resolved Pierre

    (@ierpe)


    Hi, and thanks for the great plugin.

    We are using the WP Bedrock Stack with the Sage theme for our sites.

    The Sage theme is using Blade files instead of regular PHP files to render views. Our ACF block render callback looks like this and it compiles Blade files :

      /**
       * Renders ACF Gutenberg block
       * */
      function my_acf_block_render_callback($block)
      {
        $slug = str_replace('acf/', '', $block['name']);
    
        if (file_exists(get_theme_file_path("views/blocks/{$slug}.blade.php"))) {
          echo \App\template("blocks.{$slug}");
        }
      }

    As a result, we cannot use your Block Types management, or your Flexible Content Dynamic Layout Preview feature, since pointing to a .blade.php file will not render the Blade code.

    Would you consider adding, at least for the Block types, a render callback option ? Since it is already an ACF feature when you register a Block, it might be feasible, what do you think ?

    Kind regards

Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Add Gutenberg Block Render Callback option’ is closed to new replies.