I created a custom block for author-bio and i have included the social icons built-in block into my custom block
after importing InnerBlocks into my block js file i have used this code in edit function:
<InnerBlocks allowedBlocks={['core/social-links']} />
and to display social icons in the frontend i have used this code:
<InnerBlocks.Content/>
But it saved and rendered only in the editor and does not saved or rendered in the frontend
How to make it rendered and displayed in the frontend
The Social Links block actually consists of two blocks: the parent
[core/social-link]
and one or more child[core/social-links]
blocks. In yourallowedBlocks
, you are restricting the<InnerBlocks>
to only allow the parent[core/social-link]
which removes the child blocks from save() even if they are defined in thetemplate
.Example setup for edit():