Skip to content

Instantly share code, notes, and snippets.

@JeffAspen
JeffAspen / elementor-section-column-spacing-controls.php
Created August 10, 2018 19:59 — forked from CNDLS/elementor-section-column-spacing-controls.php
Add custom spacing controls to Elementor's Section and Column elements.
<?php
/*
* Add custom spacing (margin and padding) controls to Elementor's Column_Element and Section_Element
* This hook means "run this function before you add the control section named 'section_advanced' on
* the element 'column' or 'section'.
*/
add_action( 'elementor/element/column/section_advanced/before_section_start', 'add_custom_spacing_controls' );
add_action( 'elementor/element/section/section_advanced/before_section_start', 'add_custom_spacing_controls' );
/**
@JeffAspen
JeffAspen / gist:dc8c2c0e87b9eed08857
Last active August 25, 2015 20:16 — forked from thegdshop/gist:3171026
WooCommerce - Add checkbox field to the checkout
<?php
/**
* Add checkbox field to the checkout
**/
add_action('woocommerce_after_order_notes', 'my_custom_checkout_field');
function my_custom_checkout_field( $checkout ) {
echo '<div id="my-new-field"><h3>'.__('My Checkbox: ').'</h3>';
//the next few lines strip "or Create an Account" from the log-in menu option
//I usually set the overall navigation to display:none; in my CSS if I know js is enabled
//I use Modernizr and check for the js class on the <html> tag with the style selector for my menu
//like: .js #navigation { display: none; }
//You'll want to add a class or ID to the <div> containing the log-in/log-out link
//usual output (with added ID):
//<li>
// <div id="log_in_options">
// <a onclick="" href="[url]">Sign in</a> or <a onclick="" href="[url]">Create an account</a>
@JeffAspen
JeffAspen / 0_reuse_code.js
Last active August 29, 2015 14:22
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console