title: Can you change Gutenberg Block Type with ACF Pro's acf_register_block function?
body: <p>I've been searching for a little while on a way to change one block type to another by using ACF's acf_register_block function and am hitting a wall.</p>
  
  <p>I'm wondering if this is possible, as per the ACF documentation, "Any argument from the JavaScript registerBlockType() function may also be used." (Source: ACF's docs, <a href="https://www.advancedcustomfields.com/resources/acf_register_block_type/" rel="nofollow noreferrer">acf_register_block_type</a> under "$settings").</p>
  
  <p>It's my understanding I should be able to tap into Wordpress' native "transforms" option to be able to convert my block type to another, similar, block type. Source: <a href="https://developer.wordpress.org/block-editor/developers/block-api/block-registration/#transforms-optional" rel="nofollow noreferrer">WP Block API - Block Registration</a></p>
  
  <p>I'm looking to convert two block types with identical fields - FAQs with Styling to/from FAQs without Styling. Below is my code, contained in my <strong>functions.php</strong> file.</p>
  
  <pre><code>// faq
      acf_register_block(
        array(
          'name'        =&gt; 'faq',
          'title'       =&gt; __('FAQ Section'),
          'description'   =&gt; __('A custom FAQ block.'),
          'render_callback' =&gt; 'my_acf_block_render_callback',
          'category'      =&gt; 'faqs',
          'icon'        =&gt; 'editor-table',
          'keywords'      =&gt; array( 'faq', 'faqs' ),
        )
      );
  
      // faq no style
      acf_register_block(
        array(
          'name'        =&gt; 'faq_no_style',
          'title'       =&gt; __('FAQ Section No Styles'),
          'description'   =&gt; __('A custom FAQ block.'),
          'render_callback' =&gt; 'my_acf_block_render_callback',
          'category'      =&gt; 'faqs',
          'icon'        =&gt; 'editor-table',
          'keywords'      =&gt; array( 'faq_no_style', 'faqs' ),
        )
      );
  </code></pre>
  
  <p>Does anyone have any input as to if this is possible? Is there a way to create blocks via JavaScript, using ACF's fields? I'm using the latest versions of Wordress and ACF.</p>
  
  <p>I have tried the following without luck:</p>
  
  <pre><code>// faq
      acf_register_block(
        array(
          'name'        =&gt; 'faq',
          'title'       =&gt; __('FAQ Section'),
          'description'   =&gt; __('A custom FAQ block.'),
          'render_callback' =&gt; 'my_acf_block_render_callback',
          'category'      =&gt; 'faqs',
          'icon'        =&gt; 'editor-table',
          'keywords'      =&gt; array( 'faq', 'faqs' ),
          'transforms' =&gt; array(
            'to' =&gt; array(
              'transform' =&gt; function() {
                print_r("test");
              },
            )
          )
        )
      );
  </code></pre>