- Paste this into your browser console.
- Start resizing the window.
- Any images that are ever displayed in a blurry fashion will throw an error and get faded out to 0.05 opacity.
View alloptions-optimizer.php
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 | |
/** | |
* Plugin Name: Alloptions Optimizer | |
* Author: Mark Jaquith | |
*/ | |
class AllOptionsOptimizer { | |
private static $usedOptions = []; | |
private static $allOptions = []; | |
private static $allOptionsBytes; |
View commit.sh
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
#!/bin/zsh | |
function maybeBail() { | |
if [[ $? -ne 0 ]]; then | |
exit 1 | |
fi | |
} | |
TYPE=$(gum choose "fix" "feat" "docs" "style" "refactor" "test" "chore" "revert") | |
maybeBail |
View admin-links-new-tab.php
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 | |
/** | |
* Plugin Name: Open Admin Links in New Tab | |
* Author: Mark Jaquith | |
*/ | |
add_action('admin_footer', function () { | |
echo <<<SCRIPT | |
<script> | |
document.body.addEventListener('click', (e) => { |
View Disable-ACF-UI.php
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 | |
// Block the ACF settings UI entirely, except on local dev. | |
if (! defined('WP_LOCAL_DEV') || ! WP_LOCAL_DEV) { | |
add_filter('acf/settings/show_admin', '__return_false'); | |
add_filter('acf/settings/capability', function () { return 'do_not_allow'; }); | |
} |
View README.md
View gform-stripe-use-older-api.php
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 | |
add_action( 'gform_stripe_post_include_api', function() { | |
if ( method_exists( '\Stripe\Stripe', 'setApiVersion' ) ) { | |
\Stripe\Stripe::setApiVersion( '2016-07-06' ); | |
} | |
}); |
View plugin.php
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 | |
/** | |
* Plugin Name: YOUR PLUGIN NAME | |
*/ | |
include( dirname( __FILE__ ) . '/lib/requirements-check.php' ); | |
$your_plugin_requirements_check = new YOUR_PREFIX_Requirements_Check( array( | |
'title' => 'YOUR PLUGIN NAME', | |
'php' => '5.4', |
View block-unnecessary-image-queries.php
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 | |
/* | |
Plugin Name: Block WordPress attachment queries | |
Description: Blocks MySQL queries for WordPress attachments that are on domains we know will never resolve to a local WordPress attachment ID. | |
Author: Mark Jaquith | |
*/ | |
add_filter( 'query', function( $query ) { | |
global $wpdb; |
View readme.md
Okay, so, let's say you have some data like this:
$things = [
0 => [ 'id' => 123, 'title' => '123 Title', 'content' => '123 Content' ],
1 => [ 'id' => 456, 'title' => '456 Title', 'content' => '456 Content' ],
2 => [ 'id' => 789, 'title' => '789 Title', 'content' => '789 Content' ],
];
View home-page-redirect.php
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 | |
function home_page_first_last_name_redirect() { | |
if ( is_front_page() && is_user_logged_in() && ! isset( $_GET['firstName'] ) ) { | |
$user = wp_get_current_user(); | |
$url = add_query_arg( array( | |
'firstName' => $user->first_name, | |
'lastName' => $user->last_name, | |
)); | |
wp_redirect( $url ); |
NewerOlder