Just like the Posting Source Code feature works in the classic editor, with the Code Block you can add formatted code for others to view.

if ( condition ) {
    action1();
    action2();
} elseif ( condition2 && condition3 ) {
    action3();
    action4();
} else {
    defaultaction();
}

In order to add a Code Block, click on the add block button and select the Code Block.

Detailed instructions on adding blocks can be found here.


Block Toolbar 

Every block comes with unique toolbar icons and block specific user controls that allow you to manipulate the block right in the editor.

The Code Block shows standard three buttons:

Change block type or style

You can transform the Code Block into the Custom HTML BlockPreformatted Block, or Group. The Group would give you the ability to change the background color around the Code Block.


Block Settings

Every block has specific options in the editor sidebar in addition to the options found in the block toolbar. If you do not see the sidebar, simply click the ‘cog’ icon next to the Publish button.