Skip to content

Instantly share code, notes, and snippets.

@JayOkey
JayOkey / gravity-copy.php
Last active January 27, 2019 11:08
This plugin has been designed to copy the value of a checked Gravity Forms radio button if it has a class of lmd-copy to element with an id of lmd-paste.
<?php
/**
* Plugin Name: Launch Me Digital Gravity Copy Radio Value
* Plugin URI: https://launchmedigital.com
* Description: This plugin has been designed to copy the value of a checked Gravity Forms radio button if it has a class of lmd-copy to element with an id of lmd-paste.
* Version: 1.0
* Author: Jay Okey
* Author URI: https://launchmedigital.com
* Copyright: (c) 2018 Launch Me Digital
* License: GNU General Public License v2.0
@JayOkey
JayOkey / glupfile.js
Created August 19, 2018 01:32
Configure Browser Sync to work with WordPress and Valet
/**
*
* How to use this file
*
* Step 1: Ensure Gulp CLI is installed globally
* npm install gulp-cli -g
* Step 2: Install BrowserSync and Gulp as a local development dependency for the project. In most cases either the plugin or the theme directory that you're working in
* npm install browser-sync gulp --save-dev
* Step 3: Save this file to the directory and edit where appropriate
* Step 4: Type glup in the command line to initiate BrowserSync
@JayOkey
JayOkey / woocommerce_button_proceed_to_checkout.php
Created June 9, 2018 01:25
How to alter the WooCommerce Proceed to checkout button including the markup, url and text.
function woocommerce_button_proceed_to_checkout() {
$checkout_url = wc_get_checkout_url();
?>
<a href="<?php echo $checkout_url; ?>" class="checkout-button button alt wc-forward"><?php _e( 'Complete Quote Request', 'woocommerce' ); ?></a>
<?php
}
@JayOkey
JayOkey / .editorconfig
Created June 8, 2018 09:49
.editorconfig style to comply with WordPress Coding Standards
# This file is for unifying the coding style for different editors and IDEs
# editorconfig.org
# WordPress Coding Standards
# https://make.wordpress.org/core/handbook/coding-standards/
root = true
[*]
charset = utf-8
@JayOkey
JayOkey / .htaccess
Created May 27, 2018 11:08
A WordPress .htaccess file that redirects http requests to https
RewriteEngine On
RewriteCond %{HTTP:X-Forwarded-Proto} !https
RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R=301,L]
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
@JayOkey
JayOkey / jo_gp_full_width_layout.php
Last active July 27, 2018 11:01
Sets the GeneratePress Page Builder Layout to full width when Beaver Builder has been used to create the layout of the page
<?php
/***
* Automatically set GeneratePress to full width layout when Beaver Builder active on page
***/
function jo_custom_body_class( $classes ) {
if ( class_exists( 'FLBuilderModel' ) && FLBuilderModel::is_builder_enabled() ) {
$classes[] = 'full-width-content';
@JayOkey
JayOkey / jo_bb_query_string_remover.php
Last active March 7, 2018 02:11
Removes WordPress query strings from Javascript and CSS files
<?php
/**
* Improve the ability to cache CSS and JS by removing query strings
**/
function remove_script_version( $src ){
if ( strpos( $src, 'uploads/bb-plugin' ) !== false || strpos( $src, 'uploads/bb-theme' ) !== false ) {
return $src;