Quantcast
Channel: WordPress.org Forums » All Topics
Viewing all articles
Browse latest Browse all 59525

Adding a Gutenberg block programmatically

$
0
0

Replies: 0

Beginning WordPress developer here. I’m working with a legacy database with lots of information in custom fields (originally created with ACF). Among them are videos I’d like to put in a Gutenberg “Embed” block, e.g. https://www.youtube.com/watch?v=dQw4w9WgXcQ .

I’ve created a custom theme (child of twentytwenty). I’ve made other custom fields appear (as plain text) by adding them to template-parts/content.php, below “the_content”.

My plan has been to add code like, “If there’s data in the wpcf-embedded-media field, add an Embed block to the page and stick the data in there.” But I can’t figure out the “add an Embed block to the page” part.

Thanks in advance for your help! (This is my first question on WordPress.org. I used to be very active on Drupal.org. Draw whatever conclusions you like from that. 🙂 )


Viewing all articles
Browse latest Browse all 59525

Trending Articles