- list functions assign variables in reverse order in PHP7
- HTTP/2
- makes things faster by managing latency
- introduces multiplexing in single TCP connections
- #core-http on slack (working group)
- CSS4
- CSS color() function coming soon
- varables in CSS
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// SVG Test | |
(function () { | |
function supportsSVG() { | |
return !!document.createElementNS && !! document.createElementNS('http://www.w3.org/2000/svg', 'svg').createSVGRect; | |
} | |
if (!supportsSVG()) { | |
document.documentElement.className += ' no-svg'; | |
// optional .png fallback for .svg files inlined as <img> elements | |
$("img[src$='.svg']").attr("src", function() { | |
return $(this).attr('src').replace('.svg', '.png'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Avoid widows in text by replacing the final space in each paragraph with a | |
* | |
* Inspired by David Walsh (http://davidwalsh.name/word-wrap-mootools-php) | |
* | |
* @param string $content Content passed into the filter | |
* @return string the filtered content | |
*/ | |
function wustl_widow_buster ($content) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"bold_folder_labels": true, | |
"color_scheme": "Packages/User/base16-ocean.dark (SL).tmTheme", | |
"detect_slow_plugins": false, | |
"folder_exclude_patterns": | |
[ | |
".git", | |
".sass-cache", | |
"bower_components" | |
], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Overrides the database for development URLs */ | |
define('WP_SITEURL', 'http://my.domain.dev'); | |
define('WP_HOME', 'http://my.domain.dev'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* A WordPress filter to avoid widows in your titles | |
*/ | |
function avoid_title_widows( $title ) { | |
// Find the last space. | |
$last_space = strrpos($title, ' '); | |
// Replace it with a non-breaking space. | |
if ( $last_space ) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function no_responsive_image_feeds() { | |
add_filter( 'max_srcset_image_width', function() { | |
return 1; | |
} ); | |
} | |
add_action('rss2_head', 'no_responsive_image_feeds' ); | |
add_action('atom_head', 'no_responsive_image_feeds' ); | |
add_action('rss_head', 'no_responsive_image_feeds' ); |
- Consider merging
get_image_tag()
andwp_get_attachment_image()
.- Nah, bad idea. While
get_image_tag()
is only used in the media editor, it probably makes sense to keep the image generation on the back end and front end separated because of how people are likely filtering display.
- Nah, bad idea. While
- Add an event listener to the editor if we can't do a content filter.
- Look into adding needed metadata directly to wp.media to avoid the ajax request
- Add caching to
attachment_url_to_postid
to speed up multiple requests. - Add smart ways to filter
sizes
globally w/o inducing anotherwp_get_attachment_image()
call.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Force URLs in srcset attributes into HTTPS scheme. | |
* This is particularly useful when you're running a Flexible SSL frontend like Cloudflare | |
*/ | |
function ssl_srcset( $sources ) { | |
foreach ( $sources as &$source ) { | |
$source['url'] = set_url_scheme( $source['url'], 'https' ); | |
} | |
return $sources; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Remove max_srcset_image_width. | |
function remove_max_srcset_image_width( $max_width ) { | |
return false; | |
} | |
add_filter( 'max_srcset_image_width', 'remove_max_srcset_image_width' ); |