Skip to content

Instantly share code, notes, and snippets.

@jacksonfdam
jacksonfdam / gist:3000321
Created June 27, 2012 00:03
Remove all "missing" files from a SVN working copy
# If you accidentally deleted files from a subversion working copy, subversion marks them missing instead of
# deleted. This command will delete them correctly from the repository.
svn rm $( svn status | sed -e '/^!/!d' -e 's/^!//' )
@eugenoprea
eugenoprea / 404.php
Last active August 27, 2019 16:34
Custom 404 Page for Genesis child themes
<?php
/**
* Handles display of 404 page.
*
* Edited by Eugen Oprea - http://www.eugenoprea.com/
*
* This file should be added in the directory of your child theme!
*
* @category Genesis
* @package Templates
@richardW8k
richardW8k / RWNotificationExtras.php
Last active September 30, 2021 21:17
Adds a new settings to Gravity Forms notifications allowing uploaded files to be attached to the notification and the notification format to be changed to text.
<?php
/**
* Plugin Name: Gravity Forms - Notification Extras
* Author: Richard Wawrzyniak
* Description: Adds new settings to Gravity Forms Notifications enabling file uploads to be attached to notifications and the notification format to be changed to text.
* Version: 1.0
*
* Last Modified: 17/10/2014
* Updated attach_file() to allow for possibility that uploads folder was changed
* Added suppot for post_image fields
@wpspeak
wpspeak / functions.php
Last active August 4, 2019 06:58
Remove 'You are here' texts in Genesis Framework breadcrumb
<?php
//* Remove 'You are here' texts in Genesis Framework breadcrumb
add_filter( 'genesis_breadcrumb_args', 'afn_breadcrumb_args' );
function afn_breadcrumb_args( $args ) {
$args['labels']['prefix'] = '';
return $args;
}
@nicholasohrn
nicholasohrn / http-basic-cron-request.php
Created July 1, 2014 21:22
WP Cron with HTTP Basic Authentication
<?php
if(defined('WP_CRON_CUSTOM_HTTP_BASIC_USERNAME') && defined('WP_CRON_CUSTOM_HTTP_BASIC_PASSWORD')) {
function http_basic_cron_request($cron_request) {
$headers = array('Authorization' => sprintf('Basic %s', base64_encode(WP_CRON_CUSTOM_HTTP_BASIC_USERNAME . ':' . WP_CRON_CUSTOM_HTTP_BASIC_PASSWORD)));
$cron_request['args']['headers'] = isset($cron_request['args']['headers']) ? array_merge($cron_request['args']['headers'], $headers) : $headers;
return $cron_request;
}
@fullybaked
fullybaked / usort.php
Created September 1, 2015 12:05
Usort with PHP7 Spaceship vs PHP5.6
<?php
// PHP 5.6
usort($array, function($a, $b) {
if ($a == $b) {
return 0;
}
return ($a < $b) ? -1 : 1;
});
@ashleyfae
ashleyfae / edd-auto-apply-discount-code.php
Created August 30, 2016 12:13
Automatically applies an EDD discount code if certain cart conditions are met.
<?php
/**
* Plugin Name: EDD - Discounts for Subscribers
* Plugin URI: https://www.nosegraze.com/apply-edd-discount-code-cart-contents
* Description: Automatically applies an EDD discount code if certain cart conditions are met.
* Version: 1.0
* Author: Nose Graze
* Author URI: https://www.nosegraze.com
* License: GPL2
*
@mgibbs189
mgibbs189 / functions.php
Created November 1, 2016 18:34
FacetWP - accessibility support
<?php
add_filter( 'facetwp_assets', function( $assets ) {
$assets['accessibility.js'] = FACETWP_URL . '/assets/js/src/accessibility.js';
return $assets;
});
@ollietreend
ollietreend / acf-php-to-json.php
Last active February 11, 2025 14:00
Convert Advanced Custom Fields Pro configuration from PHP to JSON.
<?php
/**
* Plugin Name: Convert ACF PHP to JSON
* Description: Convert Advanced Custom Fields Pro configuration from PHP to JSON.
*/
namespace ConvertAcfPhpToJson;
/**
* Add submenu item under 'Custom Fields'
<?php
/*
Plugin Name: GF file upload to ACF image field
Plugin URI: https://gist.github.com/certainlyakey/8c19791b3133beb62d323bf060bf4270
Description: Map Gravity forms file upload field to ACF image/file field so GF would upload the file and save id to DB instead of URL.
Version: 1.0.0
Author: Kellen Mace
*/