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 | |
// Example long query (2.557 seconds): | |
// @see https://radleysustaire.com/s3/1c66a3/ | |
// Example optimized query (0.316 seconds): | |
// @see https://radleysustaire.com/s3/fb794e/ | |
// Example of what your code would look like: | |
$args = array( | |
'taxonomy' => array( 'account-menu' ), |
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: A+A Gravity Forms Dynamic Progressbar | |
Description: Gravity Forms that use a progressbar for multiple pages will adjust as answers are filled in, rather than only when progressing to the next page. | |
Author: Radley Sustaire, Alchemy + Aim | |
*/ | |
class AA_GF_Dynamic_Progressbar { | |
public function __construct() { |
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
//Imports | |
import crafttweaker.api.tag.MCTag; | |
/* | |
************* | |
* a * b * c * | |
************* | |
* d * e * f * | |
************* | |
* g * h * i * |
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 | |
// Based on: | |
// https://www.wpbeginner.com/wp-tutorials/how-to-add-custom-post-status-for-blog-posts-in-wordpress/ | |
// https://rudrastyh.com/wordpress/custom-post-status-quick-edit.html | |
class BP_Custom_Post_Status { | |
public $post_types = array( 'videographer', 'photographer' ); | |
public function __construct() { |
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 log_gettext_string( $text ) { | |
global $mylist; | |
if ( !isset($mylist) ) { | |
$mylist = array(); | |
register_shutdown_function(function($a = null) { global $mylist; echo implode('<br>', $mylist); exit; } ); | |
} | |
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 | |
// Both of these work | |
// @hook do_action( 'gform_stripe_fulfillment', $session, $entry, $feed, $form ); | |
function bpc_debug_stripe( $session, $entry, $feed, $form ) { | |
error_log( 'Payment received for STRIPE' ); | |
} | |
add_action( 'gform_stripe_fulfillment', 'bpc_debug_stripe', 20, 4 ); | |
// @hook do_action( 'gform_paypal_fulfillment', $entry, $feed, $transaction_id, $amount ) |
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+A Error Reporter | |
* Created by radley@alchemyandaim.com | |
*/ | |
if ( !isset($error) || !isset($handled) ) { | |
echo 'Error: Unhandled exception occurred and required parameters $error and $handled were not supplied in '. __FILE__ .':'. __LINE__; | |
exit; | |
} |
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
problem: | |
"npm i" fails with an error that Python failed to compile something like "%s.%s.%s" | |
solution 1: | |
revert python 3.8.5 to 2.7.13 to fix a compiler error | |
solution 2: | |
to install python and VC Redist automatically run: | |
npm install --global windows-build-tools |
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 | |
/** | |
* Triggers an action after the "acf/save_post" action, priority 1000. | |
* If hooks are not called, they will be called at the end of the PHP thread | |
* | |
* Specify your callback as the first argument, and any arguments to pass to it as the second argument. | |
* | |
* @param callable Callback | |
* @param post_id The ACF-formatted post id you want to hook into |