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
(function($) { | |
// Any generic functions can go here... | |
$(document).ready(function($){ | |
// Anything that needs to wait for the document to be ready goes here | |
}); |
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 object contains a string value that in contains a single quote, | |
// a double quote, a backtick, and a backslash. | |
const data = { foo: `a'b"c\`d\\e` }; | |
// Turn the data into its JSON-stringified form. | |
const json = JSON.stringify(data); | |
// Now, we want to insert the data into a script body as a JavaScript | |
// string literal per https://v8.dev/blog/cost-of-javascript-2019#json, | |
// escaping special characters like `"` in the data. |
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
$fakeUserName = "Some Engineer" | |
$fakeUserDescription = "A fake engineer used for testing purposes" | |
$groups = @( | |
[System.Tuple]::Create('My Group', 'Users who have two thumbs'), | |
[System.Tuple]::Create('My Other Group', 'Users who have no thumbs') | |
) | |
function GetADSI() | |
{ |
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 | |
/* | |
* Plugin Name: WP REST API Demo | |
* Plugin URI: https://gist.github.com/wpscholar/693517420ca6c9e29e7719ef24e7e00f | |
* Description: A developer plugin designed for playing around with the WordPress REST API. | |
* Version: 1.0 | |
* Author: Micah Wood | |
* Author URI: https://wpscholar.com | |
* License: GPL2 |
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 | |
/* | |
* Plugin Name: WP REST API - Allow All CORS Requests | |
* Description: Adds headers to allow cross-origin requests to the WordPress REST API. | |
* Version: 1.0 | |
* Plugin URI: https://gist.github.com/wpscholar/59f5708cba291a314375b2dedd104e1e | |
* Author: Micah Wood | |
* Author URI: https://wpscholar.com | |
*/ |
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 | |
/** | |
* Gravity Perks // GP Limit Submissions // Apply Limit Collectively to Group of Forms | |
* http://gravitywiz.com/documentation/gravity-forms-limit-submissions/ | |
*/ | |
add_filter( 'gpls_rule_groups', function( $rule_groups, $form_id ) { | |
// Update "123" to the ID of the form that will share its feeds with the other forms. | |
$primary_form_id = 123; |
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
<?php // don't copy this line | |
add_action( 'wp_enqueue_scripts', 'gv_dequeue_main_css', 30 ); | |
add_action( 'wp_print_scripts', 'gv_dequeue_main_css', 2 ); | |
function gv_dequeue_main_css() { | |
wp_dequeue_style( 'gravityview_default_style' ); | |
wp_dequeue_style( 'gravityview_style_default_table' ); | |
wp_dequeue_style( 'gravityview_style_default_list' ); |