• Resolved James Hunt

    (@bonkerz)


    I’m trying to register a block template using PHP. I need to be able to add modifiers to the block. For example, adding bold or italics to a heading block. My code below works, I am just unable to find out how to add strong or italic to the template. Can anyone help?

    My current block template:

    array(
        'core/heading',
    	array(
    		'level'       => 1,
    		'content' => 'This is the page title',
    	),
    ),

    I have tried things like the following (strong = true):

    array(
        'core/heading',
    	array(
    		'level'       => 1,
    		'content' => 'This is the page title',
    		'strong' => true,
    	),
    ),

    But this does not work. Any help?

Viewing 1 replies (of 1 total)
  • Thread Starter James Hunt

    (@bonkerz)

    Worked it out. Just add it to the content!

    array(
        'core/heading',
    	array(
    		'level'       => 1,
    		'content' => '<em>This is the page title</em>',
    	),
    ),
    • This reply was modified 3 years, 8 months ago by James Hunt.
Viewing 1 replies (of 1 total)
  • The topic ‘Adding italics to block template’ is closed to new replies.