2017’s two major WordPress releases introduced several new widgets. Audio, video, gallery, and image, among others. Most of the new widgets are media-related, and require users to interact with WordPress’s media modal and media library.
The media modal has been a source of significant frustration in the past for screen reader users, unless you use a specific commercial screen reader and your version of that commercial screen reader is up-to-date. The level of frustration has been significant enough to discourage people who use screen readers to leave out media on their sites altogether and opt to use closed platforms to share their media instead.
And yet, you can’t build a modern site without some media included. Media like images can help break up walls of text, making your content easier to read. This means that the media modal is unavoidable. Thanks to incremental improvements in both the code used to build the WordPress media modal, as well as improvements in NVDA 2017.4, the frustration level has been significantly decreased, and while the experience isn’t completely frictionless, adding media to widgets, posts and pages is no longer something that’s a stretch to reach for people who use screen readers.
I decided to turn this section of the tutorial on widgets into its own separate post for easier reference, and because the general widgets tutorial is already long. This material will also come up again when we get to the sections on editing and creating posts and pages, and I’ll reproduce these steps in those sections so you don’t have to refer back to this post in order to find them. I’ll go through adding the audio widget step-by-step, from first adding the widget to selecting audio for it. Because the process is almost identical for the image, video, and gallery widgets, I’ll note the differences between these and the audio widget. With all of that said, let’s get started.
The Audio Widget
From your widgets screen, with accessibility mode activated, navigate to the heading labeled “Audio”. Press the up-arrow key once until you encounter a link labeled “Add audio,” and then press enter on that. On the next screen, navigate to the heading labeled “Widget Audio,” or press your screen reader’s shortcut key for navigating to an edit field specifically, or a form control in general, to navigate to the “title” field for this widget. Using the shortcut key to navigate to an edit field specifically will be quicker, because if you navigate to form controls in general, you’ll have to move past the “expand/collapse menu”, “help”, and “screen options” buttons.
Once you’ve navigated to the “title” field, enter a title. If you decide that you don’t want a title for this instance of the audio widget, leave it blank. If you decide to leave the title blank, your audio widget will not have any heading associated with it. This can impair your site’s useability for some users, so if your audio widget contains a piece of content you’d rather your users not skip, consider giving it an enticing title that will grab attention and interest your users in exploring your audio content.
Directly below the “title” field, you’ll find a message that says “No audio selected”. This message will disappear once you’ve selected an audio file for the widget. Beneath the message, you’ll find a button labeled “Add Audio.” Press enter on this, and the fun begins.
Once you press enter on the “Add Audio” button, focus moves to the media modal. This modal appears at the bottom of the document object model, which means it appears after the “Thank you for creating with WordPress” message. Once you’ve navigated into the modal, the first thing you’ll find is the “Close media pannel” button. If you press enter on this, the media modal closes, and focus moves back to the “Add Audio” button. Press the “Add Audio” button again to re-open the modal if you’ve accidentally closed it.
Directly below the “Close media pannel” button, you’ll find two links:
- “Add audio”, which is selected by default, and
- “Insert from URL”, which you can select by pressing enter if you don’t want to or can’t host the media yourself, and you want to insert it into the widget from another source.
Next, you’ll find a heading at level one with the text” “Add audio”. This text will change to “Insert from URL” if that option is selected. Directly beneath the level-one heading, you’ll find two links:
- Upload files, and
- Media library, which is selected by default.
Below these two links, you’ll find a combo box that allows you to filter media by the date it was uploaded to your media library, and the default value is “All dates”. Below the date combo box, you’ll find a search form you can use to search for media. If you leave the search field blank, you’ll see a list of all audio you’ve uploaded to your site, shown according to filename. Each filename is a checkbox. Once you check the filename you want to insert, you’ll be dropped into browse/forms mode, and your screen reader will announce the URL of the file you’re inserting. The field you’re being dropped into is the search field. If you press tab, you’ll be able to navigate through the list of all the audio you’ve uploaded, and you’ll hear a message letting you know which filename you’ve selected, and that you can deselect it. Pressing tab again, you’ll hear “filename checkbox checked deselect button”, where “filename” is the name of the file.
We interrupt this important program to bring you a message of gladness and sincere thanks.
Wait, did you say we can select previously uploaded media?
Yes. You read that correctly. If you’ve already uploaded any kind of media to your WordPress installation, you can now select media you’ve already uploaded to be inserted into your widget, instead of having to re-upload the media again if you want to use it, and you can check and uncheck boxes without being in browse mode. For a while, you could only do this if you were using Jaws for Windows. If you were a VoiceOver or NVDA user, or you used another screen reader altogether, you had to switch to using Jaws for Windows in order to work with the media modal. Switching back and forth between screen readers is nothing new. People who use screen readers do this all the time. Switching back and forth while you’re in the middle of a task like adding content to your website is particularly frustrating though, and for some of us is a major interruption. I can’t speak for anyone else, but I’m extremely happy about the fact that this is no longer necessary when I’m adding media in WordPress. Happy as in jumping up and down like a kid at Christmas. The media modal has been a huge bugbear for the WordPress Accessibility Team, so much so that several of us have given up on it and have been just hoping that it would be completely eliminated. For me personally, this part of editing and creating WordPress sites is the only part I’ve hated. Now that I can do something as simple as check boxes to select already-uploaded media while using my favorite screen reader, I hate this process a lot less.
OK, we now return you to your regularly-scheduled program.
Once you’ve selected the file you want to insert, press your screen reader’s shortcut key to navigate to the next edit field. The first one you’ll find in this group is a read-only field listing the URL of the file. Next, you’ll find a field where you can change the title of the file. This doesn’t change the filename on the server, but it does change the title the media is stored with in your database. Once you’re done with the title, you can press tab and fill in the artist, album, caption, and description. All of this information is optional, and you can choose to do nothing with these fields. Beneath the “Description” field, you’ll find a button labeled “Add to widget”. Pressing this will add the audio you’ve selected to your widget. You can also upload new audio directly from this screen, and follow the same insertion proceedure. Once this is done, you’ll select a sidebar for the widget as well as its position, as with any other widget. The media modal will close once you’ve made your selection and inserted your media, and you’ll be back where you started. However, the button labelled “Add Audio” now has a label of “Edit Audio”, and the “No audio selected” message is replaced by a player you can use to preview your audio selection.
To remove the audio you’ve chosen, press enter on the “Edit audio” button. The media modal will re-open, and your focus will move to the “Close media pannel” button. Below this is a link labelled “Cancel edit.” This is followed by a link labelled “Audio details,” and this is selected by default. So the heading at level one on this page contains the text: “Audio details.” Directly below the “Audio details” heading is another player you can use to preview your audio, followed by an edit field containing the audio file’s URL which you can edit, and a button labelled “Remove audio source.” Pressing this button will remove your audio from the widget and return you to the “Add audio” button, with the message “No audio selected” above it.
Below the “Remove audio source” button, you’ll find a prompt advising you to add alternative sources for maximum HTML 5 playback. This is because not all browsers support every file format, and so for the most coverage, you either need to use a file format they all support, (like Mp3), or if you choose to use a file format only supported by some browsers, you can add alternate formats for the rest. To add an alternative format, press enter on the button below the alternative format prompt. This button is labeled “Ogg”, but once you’ve pressed enter on this and moved to the next screen, you can choose any format WordPress supports. If WordPress doesn’t support a particular format, you won’t see files with that extension when you’re either browsing through your media library or uploading a file.
When “Insert from URL” is selected, the “Add media” pannel becomes much simpler, at least for audio. You’re given a field to input a URL to an audio file, and an “Add to widget” button. You’ll still need to make sure you link to a file format supported by WordPress, and to keep things simple, I’ll suggest again that you stick to mp3, since everyone supports it. You do not have the opportunity to add any meta data to your audio if you insert from URL.
The Image and Video Widgets
To add an image or video widget in WordPress, you’ll follow the same process as you followed to add the audio widget. The differences will be the file format you can choose from, which will differ for both image and video, and the types of meta data you’ll enter for the image or video will be different: Alternative text for example instead of artist. With the image widget, you also have the ability to link the image to nothing, directly to the media file, to the image’s attachment page so people can view all the details of the image, or to a custom URL. These options are contained in a combo box. You’ll also be able to choose an image size: Small, medium, medium-large, and large. The specifics of each size are dictated by your theme, and when you upload images to your media library, WordPress generates all necessary sizes so that different sizes can be served to different browsers depending on screen size. Mobile devices get a smaller image size, for example. When inserting an image from a URL, you have the option to link to the image itself, a custom URL, or no URL at all. On this screen, these options are buttons and not a combo box. When inserting video from a URL, you can insert from any of the providers WordPress supports, including Youtube. This means that you can host your videos on Youtube, (as long as you follow their content guidelines), and have the player show up on your site, without having to work directly with embed code.
Once you’re done editing your image or video details, press enter on the “Add to widget” button, and the media modal will close. You can then choose the sidebar for the widget and save it.
The Gallery Widget
With WordPress’s gallery widget, you’ll add images just as you would for the single image widget, and you’ll edit each image’s details before you insert it into the gallery. As you’re adding images and editing details, WordPress will let you know how many images you’ve selected with a prompt that appears just below the “description” field for the image you’re editing. Directly below this prompt, you’l find a button labeled “Edit selection”, which you can use to remove images you’ve already selected. To clear the entire selection, press enter on the button labeled “Clear” just beneath the button labeled “Edit selection”. Once you’re done adding all your images, you’ll insert the whole gallery into the widget, and then choose its sidebar as usual.
I have no idea who exactly is responsible for the fixes to NVDA and WordPress that produced the alignment of stars which allows people who use screen readers to use already-uploaded media when adding widgets or content within posts. Maybe these changes are tiny in the grand scheme of both projects, and whoever made them is thinking they’re not very impactful. Spoiler alert: They’re huge. I have a feeling I know who made the changes in WordPress. If I’m wrong, please feel free to correct me. But if it’s who I think it is, Andria, I owe you at least one drink if we ever meet in person. On the NVDA side, I’ve searched the 2017.4 issues, and I’m not coming up with anything. All I know is this wasn’t possible with 2017.3 when I was writing the original widgets tutorial. That’s part of the reason why this content isn’t part of that. I sent a direct message to one NVDA regular contributor asking about this, and I haven’t heard back. So whoever you are on the NVDA side, thank you for whatever you did. You’ve helped make my life a whole lot easier, and, (along with those who work on making WordPress more accessible), opened up the possibility for me to do at least two things. First, I can haz photoblog now yay. Second, when I’m building sites for clients, I now have a choice to decide whether or not to hire someone else to handle the media portion. So, whoever you are, a thousand thanks, and if we ever happen to meet in person, I also owe you at least one drink.
Everyone else, you can now start adding media to your sites now without a ton of frustration and anger. Go forth and make your sites rich and pretty.