Remove formatting when pasting text by default

March 16, 2024

When pasting text into the WordPress classic editor, the default behavior is to keep the formatting of the pasted content. The keeps things like links working, but it also keeps font colors, sizes, and other formatting that may be undesirable. To change the default behavior so that by default all formatting is removed, we can […]

Read More

Adding a menu item to the Beaver Builder admin menu

January 28, 2024

Beaver Builder has a top level menu item in the WordPress admin menu. However, it doesn’t allow new menu items to be added using the standard WordPress methods. After reading a bunch of the Beaver Builder code base, I was able to find the filter that handles the submenu items in the /extensions/fl-builder-user-templates/classes/class-fl-builder-user-templates-admin-menu.php file. The […]

Read More

Improving Beaver Builder’s Video Lightbox

December 8, 2023

For some reason, Beaver Builder’s video lightbox opens quite small, even on large screens. I wanted the lightbox to take up most of the screen, so I used the following CSS to make that happen: .mfp-iframe-holder .mfp-content { max-width: 95%; aspect-ratio: 16/9; height: auto; } @media (min-aspect-ratio: 16/9) { .mfp-iframe-holder .mfp-content { height: 95%; aspect-ratio: […]

Read More

Disable WordPress Comments Programmatically

August 30, 2023

This post exists primarily for my own future reference. Sometimes I want to disable all comments without using a plugin. The code below borrows heavily (maybe even copies blatantly!) from a couple GitHub repositories I came across a while ago: – – Here’s the code: /** * Disable post type support for comments […]

Read More

The Trouble with Accessibility Overlays

November 29, 2022

I think I first became familiar with when their clients started getting sued for accessibility issues ( Among people working in the accessibility field, overlays like Accessibe have such a bad reputation that 700 specialists have signed the Overlay Fact Sheet ( explaining the pitfalls of accessibility overlays. In my own testing, I’ve noticed […]

Read More

Enabling SmartSlider3 Support for the Editor Role

October 26, 2022

By default, the SmartSlider3 plugin only allows administrators to create/edit/delete sliders. In many cases, administrators may want to grant editors the ability to manage sliders. To do that, the following code can be placed in the active theme’s functions.php file (or in a plugin). /** * Give editors access to SmartSlider3 * * @see: […]

Read More

WPEngine and the Advanced Cache File

April 28, 2022

Today I ran across a strange situation where the dev tools for Chrome and Firefox were reporting different background color values for the same button. They were both reporting that the relevant CSS was in the same location, so it wasn’t a matter of a difference in cascade/priority. I changed the color value in the […]

Read More

CSS Hover: Targeting Mouse Input and Ignoring Touch Input

March 30, 2022

CSS hover states are pretty obviously targeted at mouse inputs, but are applied in strange ways to touch inputs as well. Thankfully, all modern browsers now support input-based media queries. This allows us to apply our hover states only to devices that truly support hover states. Here is the code that makes it work: @media(hover: […]

Read More