- 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 Disable-ACF-UI.php
<?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
<?php | |
add_action( 'gform_stripe_post_include_api', function() { | |
if ( method_exists( '\Stripe\Stripe', 'setApiVersion' ) ) { | |
\Stripe\Stripe::setApiVersion( '2016-07-06' ); | |
} | |
}); |
View plugin.php
<?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
<?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
<?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 ); |
View suicidal-filter.php
<?php | |
/* | |
Use this just like `add_filter()`, and then run something that calls the filter (like | |
`new WP_Query`, maybe). | |
That's it. If the filter gets called again, your callback will not be. | |
This works around the common "filter sandwich" pattern where you have to remember to | |
call `remove_filter` again after your call. |
View wp-update-plugins-git.sh
#!/bin/bash | |
PLUGINS=$(wp plugin list --update=available --field=name | tr -d '\r'); | |
wp plugin update-all; | |
for plugin in $PLUGINS; do | |
git add -A "wp-content/plugins/$plugin"; | |
git commit -m "Update plugin: $plugin"; | |
done; |
View iMessage.sql
SELECT COUNT(*) as messages_count, handle.id as person from message JOIN handle on handle.ROWID = message.handle_id WHERE strftime( '%Y-%m', datetime(message.date + strftime('%s','2001-01-01'), 'unixepoch')) = '2016-01' GROUP BY handle_id ORDER BY messages_count DESC; |
NewerOlder