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
#!/bin/zsh | |
# Script to force install Gravity Forms and All Add-ons via Gravity Forms CLI (https://docs.gravityforms.com/category/add-ons-gravity-forms/wp-cli-add-on/) | |
# Note: You must `define('GF_LICENSE_KEY','your_license_key')` with a valid Elite or higher License key | |
# Install Gravity Forms Core Plugin | |
wp gf install --force --activate | |
addons=( | |
"gravityforms2checkout" |
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
# Don't load custom stuff if LocalWP shell | |
if [[ -z ${PHPRC+z} ]] | |
then | |
echo "Export custom binaries" | |
# Eg. | |
# export PATH="/opt/homebrew/opt/[email protected]/bin:$PATH" | |
# export PATH="/opt/homebrew/opt/mysql-client/bin:$PATH" | |
fi |
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
# Use Alpine Linux | |
FROM alpine:latest | |
# Environments | |
ENV TIMEZONE Etc/UTC | |
ENV PHP_MEMORY_LIMIT 512M | |
ENV MAX_UPLOAD 50M | |
ENV PHP_MAX_FILE_UPLOAD 200 | |
ENV PHP_MAX_POST 100M |
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
window._trackJs = { | |
onError: function (payload){ | |
if(payload.file.indexOf("chrome://") !== -1){ return false; } // many extensions have a source file of chrome://some/extension/path.js | |
return true; | |
} | |
// other stuff | |
} |
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 | |
/** | |
* Setup JSON Ajax endpoint | |
*/ | |
add_action('wp_ajax_secure_endpoint', 'secure_endpoint_callback_function'); | |
add_action('wp_ajax_nopriv_secure_endpoint', 'secure_endpoint_callback_function'); | |
function secure_endpoint_callback_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
<?php | |
/** | |
* Setup JSON Ajax endpoint for Javascript async access to WP data | |
*/ | |
add_action('wp_ajax_load_posts', 'load_post_callback'); // Enable for logged-in users | |
add_action('wp_ajax_nopriv_load_posts', 'load_post_callback'); // Enable for anonymous users | |
function load_post_callback(){ |
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 | |
// enque script | |
wp_enqueue_script( "myScript", get_template_directory_uri()."/js/myscript.js", array('jquery'), '1.0',true); | |
// Setup our data | |
$myDataArray = array( | |
'data' => array( // Add some data | |
'person' => array( | |
'name'=>'Nick', |
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 | |
/** | |
* Setup JSON Ajax endpoint for Javascript async access to WP data | |
*/ | |
add_action('wp_ajax_my_action_1', 'my_callback_function_1'); // Enable for logged-in users | |
add_action('wp_ajax_nopriv_my_action_1', 'my_callback_function_1'); // Enable for anonymous users | |
function my_callback_function_1(){ |
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 | |
// Setup our data | |
$myDataArray = array( | |
'ajax_url' => admin_url( 'admin-ajax.php' ), | |
); | |
// Pass data to myscript.js on page load | |
wp_localize_script( "myScript", "myLocalizedData", $myDataArray ); |
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 | |
// Setup our data | |
$myDataArray = array( | |
'data' => array( // Add some data | |
'person' => array( | |
'name'=>'Nick', | |
'job' => 'Developer' | |
) | |
) |
NewerOlder