Ignoring files in a Git repo without touching .gitignore

Over several years now I’ve used Git in developing patches for WordPress core, for which we committers still use SVN to actually commit patches, for better or worse. While working on patches in a fork, however, Git is definitely for better. I’ve found a lot of value in using GitHub for reviewing and collaborating on … Continue reading Ignoring files in a Git repo without touching .gitignore

Previewing content changes across multiple site templates

A couple days ago Helen Hou-Sandí live tweeted her first time trying out Gutenberg, the feature plugin for the next generation WordPress editor. One of her tweets stood out to me and started a thread: tl;dr You can use the Customize Posts plugin to add and edit posts in the Customizer and preview your changes—to the title, … Continue reading Previewing content changes across multiple site templates

Defining “context” in the WP REST API

I got a question from a colleague last week regarding the context parameter in the WP REST API: In which cases would the request be a GET request but the context be edit? I was thinking that perhaps if an object is edited and a child is embedded, then maybe getting that child would be with … Continue reading Defining “context” in the WP REST API

Reducing command line args required for running PHPCS

When you run JSHint, the only thing you need to put on the command line is: jshint. No additional arguments are required to check JS files under the current directory, and it automatically looks for a .jshintrc file for its configuration. For years now when I’ve wanted to similarly run PHP_CodeSniffer to check the adherence of some PHP code against coding standards, … Continue reading Reducing command line args required for running PHPCS

Adding Meta Fields to a Widget Sidebar Section in the Customizer

On the Post Status Slack, an interesting question was raised by Richard Buff: Another customizer question: I’m trying to add a custom control that’s meant to customize the appearance of a specific widget area (like change the background color). Example: And I can do it, by passing the section id of that particular widget area (“sidebar-widgets-front-page-1”) … Continue reading Adding Meta Fields to a Widget Sidebar Section in the Customizer

Previewing Themes with Adaptive Designs in the Customizer

In WordPress 4.5 the customizer introduced device preview buttons for resizing the window to see what the theme looks like in desktop, tablet, and mobile (see #31195): This feature is specifically intended for themes that implement responsive web design (RWD) that applies the device-specific layouts via CSS media queries. Most themes should take this RWD … Continue reading Previewing Themes with Adaptive Designs in the Customizer

Reviewing a Subset of Commits in a GitHub Pull Request

For many years now, GitHub has provided a compare view to see the differences between any two commits, taking the form of: http://github.com/<USER>/<REPO>/compare/[<START>…]<END> This has been useful in the context of long-running pull requests to see just a subset of the changes. But there has been a big problem with this view: you cannot comment on such a compare … Continue reading Reviewing a Subset of Commits in a GitHub Pull Request

Resetting the Customizer to a Blank Slate

Sometimes it is desirable to be able to load the customizer without any of the panels, sections, controls, or settings that would normally be registered by core, themes, or plugins. For instance, in Customize Posts there is the ability to open the customizer via the “Preview” button from the edit post screen. When the customizer … Continue reading Resetting the Customizer to a Blank Slate