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( 'pll_rel_hreflang_attributes', function( $hreflangs ) { | |
$app_slug=aw2_library::get('app.slug'); | |
if($app_slug == 'root') return $hreflangs; | |
$default_lang = pll_default_language(); | |
$hreflangs_new = array(); | |
foreach($hreflangs as $key=>$url){ | |
$url_slug = site_url().'/'.$key; |
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_action('event_tickets_rsvp_attendee_created', 'awesome_trigger_attendee', 11,3); | |
function awesome_trigger_attendee($attendee_id, $event_id, $order_id ){ | |
$attendee_post = get_post($attendee_id); | |
$trb = new Tribe__Tickets__RSVP(); | |
$attendee = $trb->get_attendee($attendee_id); | |
$data['first_name']=$attendee['holder_name']; |
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/sh | |
# /etc/nginx/geoip_update.sh | |
# Update GeoIP proxy list to the current list of cloudflare IP addresses | |
outfile=$(dirname "$0")/cloudflare_proxy_ips.conf | |
echo "# Auto-generated by $0" > "$outfile" | |
( | |
curl https://www.cloudflare.com/ips-v4 | |
) | while read ip; do |
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
// parameters for ajax calls | |
var items = [ | |
{ 'gender': 'male', 'nat': 'US' }, | |
{ 'gender': 'female', 'nat': 'GB' } | |
]; | |
// function to trigger the ajax call | |
var ajax_request = function(item) { | |
var deferred = $.Deferred(); |
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/bash | |
# | |
#color codes | |
CYANBG='\033[0;96m' | |
GREEN='\033[0;92m' | |
YELLOW='\033[0;33m' | |
ORANGE='\033[38;5;208m' | |
NC='\033[0m' # No Color | |
DATE=$(date +%d%m%Y) |
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
#!/usr/bin/env bash | |
# Back up Script to Amazon S3 | |
# Source: | |
# Author: Amit | |
#create array of sites based on folder names | |
SITELIST=($(ee site list --enabled | sed 's/\x1b\[[0-9;]*[a-zA-Z]//g')) | |
for SITE in ${SITELIST[@]}; do | |
ee site info $SITE |
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
#!/usr/bin/env bash | |
# Back up Script to Amazon S3 | |
# Source: | |
# Author: Amit | |
#path to WordPress installations | |
SITESTORE=/var/www | |
#S3 bucket | |
S3DIR="s3://<BUCKETNAME>/" |
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
#!/usr/bin/env bash | |
# Back up Script to Daily Full Backups | |
# Source: | |
# Author: Amit | |
DAY=$(date +"%Y%m%d-%H%M") | |
DAY2=$(date +"%Y%m%d") | |
DAY3=$(date +"%Y%m") | |
mkdir -p /var/log/psx/$DAY3/$DAY2 |
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
#!/usr/bin/env bash | |
# Back up Script to Amazon S3 | |
# Source: | |
# Author: Amit | |
DATE=$(date +%Y%m%d%H%M) | |
LOGFILE=/var/log/prod-restore/$DATE.log | |
EMAIL='' |
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
#!/usr/bin/env bash | |
# Back up Script to Daily Full Backups | |
# Source: | |
# Author: Amit | |
DAY=$(date +"%Y%m%d") | |
MONTH=$(date +"%Y%m") | |
YEAR=$(date +"%Y") | |
YDAY=$(date -d '-1 day' '+%Y%m%d') |
NewerOlder