Skip to content

Instantly share code, notes, and snippets.

View rachelbaker's full-sized avatar

Rachel Baker rachelbaker

View GitHub Profile
<?php
/**
* Plugin Name: Lazy Load
* Description: Lazy load images to improve page load times. Uses jQuery.sonar to only load an image when it's visible in the viewport.
* Version: 0.6
*
* Code by the WordPress.com VIP team, TechCrunch 2011 Redesign team, and Jake Goldman (10up LLC).
* Uses jQuery.sonar by Dave Artz (AOL): http://www.artzstudio.com/files/jquery-boston-2010/jquery.sonar/
*
* License: GPL2
/*
* Filesystem interaction method.
* Checks for existence first in case it has already been set in wp-config.php.
*/
if ( ! defined( 'FS_METHOD' ) ) {
define( 'FS_METHOD', 'direct' );
}
/**
* Load WordPress Filesystem API
function sm_custom_html_tags() {
global $allowedposttags;
$allowedposttags['iframe'] = array(
'src' => true,
'width' => true,
'height' => true,
'frameborder' => true,
'webkitallowfullscreen' => true,
'mozallowfullscreen' => true,
{
"folders":
[
{
"folder_exclude_patterns":
[
"build",
"src/wp-content/plugins/wp-api/coverage",
"node_modules"
],
@rachelbaker
rachelbaker / wp-seo-meta-humility.php
Created December 31, 2014 15:54
WordPress SEO Meta Humility
<?php
/**
* Plugin Name: WordPress SEO Meta Humility
* Plugin URI:
* Description: Puts the WordPress SEO meta box in it's rightful place on Edit
* screens. Reduces the priority level of the WordPress SEO plugin's meta box
* to 'default'.
* Version: 0.1.0
* Author: Rachel Baker
* Author URI: http://10up.com
var r = R.player, oVol = r.volume(), tf = r._onTrackFinished, ar = r._onAudioReady;
r._onTrackFinished = function() {
return .001 !== r.volume() && (oVol = r.volume()), r.volume(.001), tf.apply(this, arguments);
};
r._onAudioReady = function() {
return r.playingAd() || r.volume(oVol), ar.apply(this, arguments);
};
@rachelbaker
rachelbaker / single-post.json
Last active August 29, 2015 14:15
WP REST API Single Post Response Comparison
{
"id": 1780,
"type": "post",
"slug": "medicare-shoes-deadline-quickly-approaching",
"link": "http://local.wordpress.dev/medicare-shoes-deadline-quickly-approaching/",
"guid": {
"rendered": "http://www.weil4feet.com/?p=1780"
},
"date": "2014-11-20T18:34:18",
"modified": "2015-02-08T18:31:25",
'self' =>
array(1) {
[0] =>
array(2) {
'href' =>
string(42) "http://example.org/?json_route=/wp/posts/9"
'attributes' =>
array(0) {
}
}
/**
* Register and load JavaScript files.
*
* Includes 'settings' array based on query parameters.
*
* @since 1.0.
*
* @see wp_enqueue_script()
* @see wp_localize_script()
*/
<logging>
<log type="coverage-html" target="coverage" title="PHPUnit"
charset="UTF-8" yui="true" highlight="true" />
</logging>