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
#!/bin/bash | |
# Upgrade from github-updater 9.x to git-updater 10.x and git-updater-pro | |
# Instructions: | |
# 1. make sure you have WP CLI installed | |
# 2. install this file in /usr/local/bin or the executable path of your choice and make sure it has execute permissions | |
# 3. make a file called .gitupdater-download-link with the your personal download link and save it to /user/local/bin | |
# 4. make a file called .gitupdater-license-key with the your pro license key and save it to /user/local/bin | |
# 5. cd into your website's root dir and run `git-updater-upgrade` |
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 widow_buster( $text, $min_words = 3, $max_chars = 16 ) { | |
$words = explode( ' ', $text ); | |
$word_count = count( $words ); | |
$char_length = strlen( $words[ $word_count - 2 ] ) + strlen( $words[ $word_count - 1 ] ); | |
// if our minimum word count and maximum character count are met, |
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 | |
/** | |
* Create a Google Calendar "add to calendar" link. | |
* | |
* This function is convienient because it does not require an API connection. | |
* Note that this only allows for adding a single event. | |
* The data does not have to exist already on any Google Calendar anywhere. | |
* This just adds your event data to the end-users GCal one item at a time. | |
* See https://stackoverflow.com/a/19867654/947370 for a full explaination of | |
* the Google Calendar URL structure. |
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 | |
// account for conflicts between GiveWP Stripe AND WooCommerce Stripe script loading | |
function squarecandy_givewp_woocommerce_stripe_resolve() { | |
// check if both Stripe plugins are active | |
if ( is_plugin_active( 'woocommerce-gateway-stripe/woocommerce-gateway-stripe.php' ) && is_plugin_active( 'give-stripe/give-stripe.php' ) ) : | |
// WC doesn't load stripe on every page. | |
// Check if they are both being enqueued in the current context before disabling one. | |
if ( wp_script_is( 'stripe', 'enqueued' ) && wp_script_is( 'give-stripe-js', 'enqueued' ) ) { | |
// @TODO - should we compare and make sure the file contents are actually the same here? | |
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
<div id="field1"> | |
<button type="button" id="sub" class="sub">-</button> | |
<input type="text" id="1" value="0" class="field" /> | |
<button type="button" id="add" class="add">+</button> | |
</div> |
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: Square Candy Hide Stream (activity monitor plugin) | |
Plugin URI: https://gist.github.com/petertwise/5468e4d793c7ad89a32cb8e27de8ae3c | |
Version: 1.0 | |
Author: Square Candy | |
Author URI: https://squarecandydesign.com | |
License: GPLv2 | |
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
#!/bin/bash | |
# Install Wordpress with Square Candy default using WP CLI | |
read -p 'Site URL (example.com): ' url | |
read -p 'Site Title: ' title | |
read -p 'WP Admin username: ' admin_user | |
read -sp 'WP Admin password: ' admin_password | |
read -p ' | |
WP Admin email: ' admin_email | |
read -p 'Database name: ' dbname | |
read -p 'Database user: ' dbuser |
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: Git Updater Ignore | |
* Plugin URI: https://gist.github.com/afragen/414612961ac500b652862096a54d62d7 | |
* Description: This plugin is used to set Git Updater to ignore specific repository slugs. | |
* Version: 0.3 | |
* Author: Andy Fragen | |
* License: MIT | |
* Requires at least: 5.2 | |
* Requires PHP: 5.6 |
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
#!/bin/bash | |
# Setup ACF Pro to use a license key in wp-config | |
# | |
# 1. Place your license key in a file called .acf-license-key somewhere your ssh user has access to it. | |
# Default is in your home directory: ~/.acf-license-key | |
# Change the setting below if you need to put it somewhere else | |
# 2. install this file in /usr/local/bin or someplace in your PATH | |
# 3. make sure you have WP CLI installed | |
# 4. run acf-install-license from the root of your wordpress install |
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
if (!-f $request_filename){ | |
set $rule_0 1$rule_0; | |
} | |
if ($rule_0 = "1"){ | |
rewrite ^/wp-content/uploads/(.*)$ https://example.com/wp-content/uploads/$1 last; | |
} |
OlderNewer