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 | |
/** | |
* Quick script to organize YummyFTP bookmarks into alphabetical sub folders | |
* Run this in whatever directory you want to organize. | |
* | |
* You can set the folders to be upper or lower case and it also does 0-9 for domains that start with numbers | |
* @package CHB\Tools\YummyFTPOrg | |
* @author Chrispian Burks <[email protected]> |
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_stripe_customer_id', function ( $customer_id, $feed, $entry, $form ) { | |
if ( rgars( $feed, 'meta/transactionType' ) == 'product' && rgars( $feed, 'meta/feedName' ) == 'Auto Pay Feed' ) { | |
$customer_meta = array( | |
'metadata' => gf_stripe()->get_stripe_meta_data( $feed, $entry, $form ), | |
); | |
$customer = gf_stripe()->create_customer( $customer_meta, $feed, $entry, $form ); | |
return $customer->id; |
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
SELECT COUNT(*) as Days, DATE_FORMAT( post_date_gmt, '%M %D, %Y' ) as pub_date FROM `wp_posts` where `post_status` = 'publish' AND post_type = 'post' GROUP BY pub_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
# Basic rules to redirect local uploads to the actual live domain. | |
# Just edit .htaccess in the app/public folder. | |
# Credit to Aubrey Portwood for the idea (https://github.com/aubreypwd) | |
RedirectMatch 301 ^/wp-content/uploads/(.*) https://DOMAIN/wp-content/uploads/$1 | |
RedirectMatch 301 ^/wp-content/themes/THEMENAME/images/(.*) https://DOMAIN/wp-content/themes/THEMENAME/images/$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
import React from "react" | |
import { Link, graphql } from "gatsby" | |
import Img from "gatsby-image" | |
import Layout from "../components/layout" | |
import SEO from "../components/seo" | |
export default ({ data }) => { | |
return ( | |
<Layout> | |
<SEO title="home" /> |
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
//Semaphore properties | |
$key = 1111; // Key can be any unique number | |
$max = 1; // Max number of connections | |
$permissions = 0666; // default permissions | |
$autoRelease = 1; // To keep from a deadlock | |
// Begin Semaphore locking | |
$semaphore = sem_get( $key, $max, $permissions, $autoRelease ); | |
if( !$semaphore ) { | |
// Probably best to log vs. error message. But should exit or return to prevent execution if we can't get the semaphore. |
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
// FIX PERMALINK OF CATEGORIES MATCHING PRIMARY CATEGORY | |
add_filter( 'wc_product_post_type_link_product_cat', function( $term, $terms, $post ) { | |
// Get the primary term as saved by Yoast | |
$primary_cat_id = get_post_meta( $post->ID, '_yoast_wpseo_primary_product_cat', true ); | |
// If there is a primary and it's not currently chosen as primary | |
if ( $primary_cat_id && $term->term_id != $primary_cat_id ) { | |
// Find the primary term in the term list |
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 | |
`dscacheutil -flushcache` | |
echo Done. DNS Restarted. |
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 filter_search($query) { | |
if ($query->is_search) { | |
$query->set('post_type', array('post', 'tribe_events', 'page')); | |
}; | |
return $query; | |
}; | |
add_filter('pre_get_posts', 'filter_search'); |
OlderNewer