Media 5.0 Guide

The blockBlock Block is the abstract term used to describe units of markup that, composed together, form the content or layout of a webpage using the WordPress editor. The idea combines concepts of what in the past may have achieved with shortcodes, custom HTML, and embed discovery into a single consistent API and user experience. editor in WordPress 5.0 brings a much needed refresh to how we interact with media in the editor. 5.0 has provided new features designed to make complex content easier to create, and is built in a way that is now truly “what you see is what you getWhat You See Is What You Get What You See Is What You Get. Most commonly used in relation to editors, where changes made in edit mode reflect exactly as they will translate to the published page.”! There are some big changes to where things are, new methods of accessing `classic` functionality, as well as new features you may not even know about. Let’s highlight a few of those!

Where is the add media button?

If you are looking for the add media button for any reason, this can be found in the classic block TinyMCE toolbar labeled “add media”. This button will trigger the media modal.

Gallery Block:

We have improved the Gallery experience with a new block that gives users a truly real time interactive Gallery.

If you need to utilize dynamic galleries that are based on post ID, or if you need to use the `post_gallery` filterFilter Filters are one of the two types of Hooks https://codex.wordpress.org/Plugin_API/Hooks. They provide a way for functions to modify data of other functions. They are the counterpart to Actions. Unlike Actions, filters are meant to work in an isolated manner, and should never have side effects such as affecting global variables and output., this can still be achieved using the `add media` button located in the classic block TinyMCE toolbar.

Wide Alignment Theme Support:

Some blocks, such as the image block, have the ability to define a “wide” or “full” alignment in the new editor. This is accomplished by adding the `.alignwide` or `.alignfull` classes, respectively, to the image’s wrapper element. A theme can opt-in for this feature by calling: 

add_theme_support( 'align-wide' );

For more information on Wide Alignment, or if you would like to explore the potential markup of images in this context, the documentation has more details.

#5-0 #dev-notes

#media