Skip to content

Instantly share code, notes, and snippets.

View gbissland's full-sized avatar

Gareth Bissland gbissland

View GitHub Profile
@spivurno
spivurno / gw-gravity-forms-unrequire-required-fields-usage.php
Last active June 13, 2022 20:04
Gravity Wiz // Gravity Forms Unrequire Required Fields for Speedy Testing
<?php
# Basic Usage
# requires that the user be logged in as an administrator and that a 'gwunrequire' parameter be added to the query string
# http://youurl.com/your-form-page/?gwunrequire=1
new GWUnrequire();
# Enable for All Users (Including Visitors)
# still requires the 'gwunrequire' parameter be added to the query string
new GWUnrequire( array(
<?php
add_action( 'init', 'prefix_disable_post_page_analysis' );
/**
* Conditionally disable the Yoast Page Analysis on post and page admin edit screens.
*
* @uses prefix_is_edit_screen
* @return NULL if we're not on the right admin screen
* @author Robert Neu <http://wpbacon.com>
* @link http://auditwp.com/wordpress-seo-admin-columns/
@bigdawggi
bigdawggi / gist:a4eb094faa213c3a1297
Created March 25, 2015 23:52
Codeship Custom Deploy Script for WPEngine
# You must set up two environment variables:
# repoSlug = slug for WP Engine repository
# themeDir = path from the top of the repository, to the theme directory
git remote add production [email protected]:production/${repoSlug}.git
git remote add staging [email protected]:staging/${repoSlug}.git
cd ${themeDir}
npm install
npm install -g bower
bower install
#!/usr/local/bin/zsh
osascript \
-e 'tell application "Notes" to activate' \
-e 'delay 1'
for f in $@*.html
do
filename=$(basename "$f")
extension="${filename##*.}"
@rochow
rochow / snippet.php
Last active September 16, 2025 14:21
Gravity Forms Don't Save Form Entries in Database
<?php
/*
USAGE
add_action( 'gform_post_submission', 'mr_remove_form_entries' ); // ALL FORMS
add_action( 'gform_post_submission_1', 'mr_remove_form_entries' ); // SPECIFIC FORM (ID = 1 in exmaple)
*/
add_action( 'gform_post_submission_1', 'mr_remove_form_entries' );
// Deletes entries from the database on the specified Gravity Forms form(s)
function mr_remove_form_entries( $entry ){
@neilgee
neilgee / svg-images.php
Created August 29, 2015 09:29
Add SVG to WordPress via Media Uploader
<?php // <~ don't add me in
add_filter('mime_types', 'themeprefix_add_svg_images');
//Allow SVG Images Via Media Uploader
function themeprefix_add_svg_images($mimetypes) {
$mimetypes['svg'] = 'image/svg+xml';
return $mimetypes;
}
@leepettijohn
leepettijohn / genesis-theme-settings.js
Last active May 4, 2022 00:54
Opening a 301 Redirect in a New Tab
/* Add this to your Genesis Theme Settings Page
in the Header and Footer Scripts Section
<script type="text/javascript"> //Be sure to add this before and after too */
jQuery(document).ready(function($){
$('a[href$="newtab"]').attr('target','_blank');
});
//</script>
@mattclements
mattclements / function.php
Last active September 30, 2025 07:50
Wordpress Disable Comments (add to function.php)
<?php
add_action('admin_init', function () {
// Redirect any user trying to access comments page
global $pagenow;
if ($pagenow === 'edit-comments.php') {
wp_redirect(admin_url());
exit;
}
@mattradford
mattradford / licence activation.php
Last active August 29, 2024 20:36
ACF5 Pro licence activation. Could be adapted for any other plugin that requires a licence key, but doesn't yet support defining it in wp-config. Fires on theme activation.
// Place this in wp-config
define( 'ACF_5_KEY', 'yourkeyhere' );
// Set ACF 5 license key on theme activation. Stick in your functions.php or equivalent.
function auto_set_license_keys() {
if ( ! get_option( 'acf_pro_license' ) && defined( 'ACF_5_KEY' ) ) {
$save = array(
'key' => ACF_5_KEY,
find . -name \.AppleDouble -exec rm -rf {} \;