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
SELECT `option_name`, `option_value` FROM `wp_options` WHERE `option_name` LIKE '\_transient\_timeout\_%' AND CAST(`option_value` AS UNSIGNED) < UNIX_TIMESTAMP() ORDER BY `option_value`; |
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 | |
/** | |
* Description: MU-Plugin of CLI command to purge WooCommerce data. | |
* Plugin URI: https://gist.github.com/crstauf/0917df51455efa1a61058c050565fe72 | |
* Author: Caleb Stauffer | |
* Author URI: https://develop.calebstauffer.com | |
*/ | |
if ( !defined( 'WP_CLI' ) || !WP_CLI ) | |
return; |
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: Development Environment Preventions | |
* Description: MU-plugin to prevent production functionality on development sites. | |
* Plugin URI: https://gist.github.com/crstauf/793d8d70dd6d2572e698f8b46ab6316b | |
* Author: Caleb Stauffer | |
* Author URI: https://develop.calebstauffer.com | |
*/ | |
$production_site_url = '{PRODUCTION SITE URL}'; |
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
add_action( 'woocommerce_webhook_delivery', function( $args, $response, $duration, $arg, $webhook_id ) { | |
$order = wc_get_order( $arg ); | |
if ( | |
empty( $order ) | |
|| is_wp_error( $order ) | |
|| !is_a( $order, 'WC_Order' ) | |
) | |
return; |
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 | |
/** | |
* Functionality to mark a dev install as dirtied (compared to production). | |
* | |
* @link https://gist.github.com/crstauf/70c983893cf88ed51d887cec4672e3af GitHub. | |
*/ | |
if ( !defined( 'ABSPATH' ) || !function_exists( 'add_filter' ) ) { | |
header( 'Status: 403 Forbidden' ); | |
header( 'HTTP/1.1 403 Forbidden' ); |
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 posts_clauses( $clauses, $wp_query ) { | |
/* reference: https://adambalee.com/search-wordpress-by-custom-fields-without-a-plugin/ */ | |
if ( !$wp_query->is_search() ) | |
return $clauses; | |
global $wpdb; | |
$clauses['join'] .= | |
' LEFT JOIN ' . $wpdb->postmeta . |
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
.screen-reader-text { | |
clip: rect(1px, 1px, 1px, 1px); | |
clip-path: polygon(0px 0px, 0px 0px,0px 0px, 0px 0px); | |
position: absolute !important; | |
white-space: nowrap; | |
height: 1px; | |
width: 1px; | |
overflow: hidden; | |
} |
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
SELECT | |
p.`post_type`, | |
COUNT( pm.`post_id` ) as postmeta_count | |
FROM `wp_posts` as p | |
JOIN `wp_postmeta` as pm | |
ON (p.`ID` = pm.`post_id`) | |
GROUP BY p.`post_type` | |
ORDER BY | |
postmeta_count DESC, | |
p.`post_type` ASC |
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
new gravityforms_api_integration; | |
add_filter( 'gform_entry_meta', array( 'gravityforms_api_integration', 'filter_gform_entry_meta' ), 1, 2 ); | |
class gravityforms_api_integration { | |
const gravityforms_api_integration_version = '0.0.1'; // https://gist.github.com/crstauf/9d63194eb6fd169b110b6301e8519ff3 | |
const gforms_version = '1.9.18'; // Gravity Forms Version | |
const service_name = ''; |
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 | |
if (is_admin()) | |
new more_post_thumbnails; | |
class more_post_thumbnails { | |
CONST version = '0.0.1'; | |
CONST github = ''; |