This is a collection of scripts, bash functions, and config files that help me do WordPress core development.
/wp
: parent folder/wp/svn
: SVN checkout/wp/git
: Git checkout/wp/{ git | svn }/wp-test-config.php
: see attached file
<?php | |
// UPDATE: This can be replaced by `define( 'WP_DISABLE_FATAL_ERROR_HANDLER', true );` in `wp-config.php`. | |
// See https://core.trac.wordpress.org/changeset/44674 | |
/** | |
* Shutdown handler to disable WordPress 5.1's plugin/theme pausing features. | |
*/ | |
class dd32_Fatal_Error_Handler extends WP_Fatal_Error_Handler { | |
// Do not store errors, this disables the ability for plugins/themes to be marked 'paused'. |
/* eslint-disable no-console */ | |
/** | |
* A little module that adds a wpapi() method to the window object. | |
* | |
* wpapi() takes an API path (e.g. /wp/v2/posts), optionally containing string query parameters, | |
* or a query-less API path and a hash object of query param objects. | |
*/ | |
( context => { | |
const { root, nonce } = context.WP_API_Settings; |
<?xml version="1.0"?> | |
<ruleset name="Ignacio"> | |
<description>Security reviews with PHPCS.</description> | |
<file>.</file> | |
<!-- Exclude the Composer Vendor directory. --> | |
<exclude-pattern>/vendor/*</exclude-pattern> | |
<!-- Exclude the Node Modules directory. --> |
import axios from 'axios' | |
let mockingEnabled = false | |
const mocks = {} | |
export function addMock(url, data) { | |
mocks[url] = data | |
} |
// 20170908135703 | |
// http://developwordpress.localhost/wp-json/wp/v2/posts/40018 | |
{ | |
"content": { | |
"id": 40018, | |
"date": "2017-09-04T19:21:42", | |
"date_gmt": "2017-09-04T19:21:42", | |
"guid": { | |
"rendered": "http://developwordpress.localhost/?p=40018" |
#!/bin/bash | |
find . -name '*.jp*' -print0 | xargs -0 -I{} -t guetzli --quality 90 {} {} |
NOTE: This is no longer an experiment! You can use the accessibility inspector in Chrome Devtools now, including a fantastic color contrast inspection tool. Read more: https://developers.google.com/web/updates/2018/01/devtools#a11y
Just like any good element inspector helps you debug styles, accessibility inspection in the browser can help you debug HTML and ARIA exposed for assistive technologies such as screen readers. There's a similar tool in Safari (and reportedly one in Edge) but I like the Chrome one best.
As an internal Chrome experiment, this tool differs from the Accessibility Developer Tools extension in that it has privileged Accessibility API access and reports more information as a result. You can still use the audit feature in the Chrome Accessibility Developer Tools, or you could use the aXe Chrome extension. :)
To enable the accessibility inspector in Chrome stable: