Force Gutenberg to Fullscreen Mode
This is an example snippet for forcing the Gutenberg editor into full screen mode in anticipation of the change coming to WordPress 5.4.
<?php | |
// Disable Jetpack's instagram shortcode since it breaks oEmbed functionality. | |
add_filter( 'jetpack_shortcodes_to_include', function ( $shortcodes ) { | |
unset( $shortcodes['instagram'] ); | |
return $shortcodes; | |
}, 99 ); | |
// Add a simple shortcode wrapper for the embed functionality to support the shortcode format. |
This is an example snippet for forcing the Gutenberg editor into full screen mode in anticipation of the change coming to WordPress 5.4.
class Test_Class { | |
public function __construct() { | |
add_filter( 'pre_get_posts', [$this, 'test_callback'] ); | |
} | |
public function test_callback() { | |
wp_die( 'Hooked up.' ); | |
} | |
} |
const colors = require('colors'); | |
const link = colors.underline.blue; | |
const error = colors.red.bold; | |
function selectorToString(selectors, separator) { | |
separator = separator || ' ' | |
return selectors | |
.reduce((prev, curr) => prev.concat(curr), []) | |
.join(separator) | |
} |
<?php | |
add_filter( 'attachment_fields_to_edit', 'attachment_location_field', 10, 2 ); | |
add_filter( 'attachment_fields_to_save', 'save_location_field', null, 2 ); | |
function attachment_location_field( $form_fields, $post ) { | |
$field_value = get_post_meta( $post->ID, 'location', true ); | |
$form_fields['location'] = array( |
_wp_attached_file
_wp_attachement_metadata
_wp_attachment_is_custom_background
(maybe?)wp_get_attachment_image_
family of functions.wp_upload_dir()
, see: #34359).40 concurrent users requesting every 1-4 seconds for 5 minutes avg was 1438 requests in 5 min (28,760/hr or 287.6/min or 4.8/sec)
Mary: | |
* Recurrence is kind of wierd/confusing. Some tutorials might be nice. | |
* We need to double check venues and some other | |
Migration: | |
* Everyone is going through stories. | |
* Slideshows are cumbersome and requires a bunch of extra work. | |
* Do we need to add promos to old med school stories |
Much of the software that we use will be installed by Jeff/Galen on your new computer. This includes MS Office, Adobe Creative Suite, Etc. This is a list of things you will need to install yourself.
function wp_css_tricks_images_responsive( $content ) { | |
/** | |
* Find all instanced of your custom image markup in the content and bail early | |
* if none are found. | |
*/ | |
if ( ! preg_match_all( '/<figure [^>]+>\s+<img [^>]+>/', $content, $matches ) ) { | |
return $content; | |
} | |
// Set up arrays to hold your images and a set of IDs that we'll cache later. |