Custom block type problem
-
Pls tell me what i am doing wrong:
My custom block types save function:
(the var props.attributes.shortcode contains: ‘[photo 5594]’)save: function( props ) { var shortcode = props.attributes.shortcode || ''; if ( shortcode.length ) { return el( 'p', null, shortcode ); } },
The content of the page in the classic editor is:
<!-- wp:wppa/gutenberg-photo --> <p class="wp-block-wppa-gutenberg-photo">[photo 5594]</p> <!-- /wp:wppa/gutenberg-photo -->
So far it works, but re-editing the post produces the error:
This block contains unexpected or invalid content.Clicking the resolve button he wants to change:
Current <p class="wp-block-wppa-gutenberg-photo">[photo 5594]</p>
into:
After Conversion <p class="wp-block-wppa-gutenberg-photo">[photo 5594]</p>
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Custom block type problem’ is closed to new replies.