This document lists all the situations where WordPress sends an email, along with how to filter or disable each email.
This documentation has moved here: https://github.com/johnbillion/wp_mail
This document lists all the situations where WordPress sends an email, along with how to filter or disable each email.
This documentation has moved here: https://github.com/johnbillion/wp_mail
<?php echo krogs_output_related_posts(); ?> |
#!/bin/bash | |
REV=$1 | |
svn up --ignore-externals . > /dev/null | |
svn merge -c$REV ../../trunk . | |
LOG=$(svn log -r$REV ../../trunk | grep -v '\-------' | tail -n +3) | |
BRANCH=$(basename $(pwd)) | |
echo -en "$LOG\n\nMerges [$REV] to the $BRANCH branch." | pbcopy | |
echo "" | |
pbpaste |
<?php | |
add_filter( 'rest_authentication_errors', function( $result ) { | |
if ( ! empty( $result ) ) { | |
return $result; | |
} | |
if ( ! is_user_logged_in() ) { | |
return new WP_Error( 'restx_logged_out', 'Sorry, you must be logged in to make a request.', array( 'status' => 401 ) ); | |
} | |
return $result; |
<?php | |
if ( defined( 'WP_CLI' ) && WP_CLI ) { | |
class JW_Random_Posts extends WP_CLI_Command { | |
private $args, $assoc_args; | |
/** | |
* Generates a Random set of posts | |
* |
[better title needed]
[insert table of contents]
WordPress uses a JavaScript task runner called Grunt to build its files. It requires the most recent LTS version of the Node.js runtime. It also requires dependencies fetched via npm. npm is packaged with Node.js, so if your computer has Node.js installed you are ready to go.
function getDocumentImages() { | |
return performance.getEntriesByType('resource') | |
.map( ( entry ) => entry.name ) | |
.filter( ( url ) => { | |
const parsedUrl = new URL( url ); | |
return /\.(png|jpe?g|gif|webp|svg)$/i.test( parsedUrl.pathname ); | |
} ); | |
} |
Instructions for how to install a WordPress plugin that is stored in a Gist (example).
There are three ways to do it:
<?php | |
/** | |
* AMP Validation Error Logger plugin initialization file. | |
* | |
* @package AMP_Validation_Error_Logger | |
* @author Weston Ruter, Google | |
* @license GPL-2.0-or-later | |
* @copyright 2019 Google Inc. | |
* | |
* @wordpress-plugin |