This file contains hidden or 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
// 3D Dom viewer, copy-paste this into your console to visualise the DOM as a stack of solid blocks. | |
// You can also minify and save it as a bookmarklet (https://www.freecodecamp.org/news/what-are-bookmarklets/) | |
(() => { | |
const SHOW_SIDES = false; // color sides of DOM nodes? | |
const COLOR_SURFACE = true; // color tops of DOM nodes? | |
const COLOR_RANDOM = false; // randomise color? | |
const COLOR_HUE = 190; // hue in HSL (https://hslpicker.com) | |
const MAX_ROTATION = 180; // set to 360 to rotate all the way round | |
const THICKNESS = 20; // thickness of layers | |
const DISTANCE = 10000; // ¯\\_(ツ)_/¯ |
This file contains hidden or 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
/** | |
* This snippet will add a datepicker to the list field of Gravity Forms. | |
* Just copy paste this snippet and complete the configuration at the bottom | |
* Also make sure that Jquery UI is loaded otherwise this won't work (<script src="https://code.jquery.com/ui/1.13.2/jquery-ui.js"></script>) | |
* | |
* @author Johan d'Hollander | |
* @link <https://geekontheroad.com> | |
**/ | |
jQuery(document).ready(function() { |
This file contains hidden or 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
# Basic queries to analyse canceled subscriptions using EDD Recurring Payments pre EDD 3.0 | |
# Use EXPLAIN if you have large stores since the "notes" column is not indexed and queries can take some time | |
# Some of these reports might be worth storing as Views and look at the graphs PHPMyAdmin can also create from them | |
# List subscription cancelation with creation and cancelation date, as well as the user who canceled | |
# good as a basis for further queries | |
SELECT ID, | |
created, | |
REGEXP_SUBSTR( REGEXP_SUBSTR( notes, '.* Status changed from active to cancelled .*' ), '^[a-z]+ [0-9]+, [0-9]+' ) AS 'date', |
This file contains hidden or 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 | |
/** | |
* By default, cURL sends the "Expect" header all the time which severely impacts | |
* performance. Instead, we'll send it if the body is larger than 1 mb like | |
* Guzzle does. | |
*/ | |
function add_expect_header(array $arguments) | |
{ | |
$arguments['headers']['expect'] = ''; |
This file contains hidden or 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_filter( 'gform_form_post_get_meta_7', 'add_form_fields' ); | |
function add_form_fields( $form ) { | |
// Don't make the parent form messy | |
if ( ! GFCommon::is_form_editor() ) { | |
// form we are adding fields to | |
$parent_id = $form['id']; | |
// template form ID | |
$childId = 5; |
This file contains hidden or 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_filter( 'generate_header_element_display', function( $display ) { | |
if ( ! has_post_thumbnail() ) { | |
return false; | |
} | |
return $display; | |
} ); |
This file contains hidden or 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 | |
/** | |
* Filters the API mode for a specific form to 'test'. | |
* | |
* @param $api_mode string Either 'test' or 'live' | |
* | |
* @return string Returns 'test' for targeted form. Otherwise, | |
* will return the value for the $api_mode setting. | |
*/ |
This file contains hidden or 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 | |
/** | |
* Payment subscriptions and updating billing and cancelling subscriptions takes place with these hooks | |
* We need the stripe customer user id for updating billing | |
* we need the entry id of subscription so we can cancel it. | |
*/ | |
/** | |
* @param $entry |
This file contains hidden or 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
array( | |
// Require WordPress version 4.6.2 or higher. | |
'wordpress' => array( | |
'version' => '4.6.2' | |
), | |
// Require PHP version 5.3 or higher. | |
'php' => array( | |
'version' => '5.3', | |
This file contains hidden or 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 | |
/** | |
* WARNING! THIS SNIPPET MAY BE OUTDATED. | |
* The latest version of this snippet can be found in the Gravity Wiz Snippet Library: | |
* https://github.com/gravitywiz/snippet-library/blob/master/gravity-forms/gw-manual-entries.php | |
*/ | |
/** | |
* Gravity Wiz // Gravity Forms // Manual Entries | |
* | |
* Create entries manually for Gravity Forms. Adds an "Add New" button next to the page title on all entry-related pages. |
NewerOlder