Skip to content

Instantly share code, notes, and snippets.

Avatar

Chad intrigue

  • Intrigue
  • New York, NY
View GitHub Profile
@andrewlimaza
andrewlimaza / register-helper.php
Created Oct 29, 2018
Register Helper Example For Paid Memberships Pro.
View register-helper.php
<?php
/**
* Copy this code (below) into your PMPro Customizations Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
*/
function my_pmprorh_init()
{
//don't break if Register Helper is not loaded
if(!function_exists( 'pmprorh_add_registration_field' )) {
return false;
@pbrocks
pbrocks / date-check.js
Created Sep 8, 2018
Add hidden PMPro registration field that shows a message when a checkbox is ticked.
View date-check.js
jQuery(document).ready(function($) {
var label = $('label[for=hidden_check]');
$(label).hide();
$('#date_check').click(function() {
if($('#date_check').is(':checked')) {
$(label).css('color','salmon').show();
$('input[name=hidden_check]').val('1');
} else {
$(label).hide();
$('input[name=hidden_check]').val('0');
@greathmaster
greathmaster / pmpro-rh-dob-check.php
Last active Jun 15, 2021
Checks birthday on checkout to confirm member is over 21 years.
View pmpro-rh-dob-check.php
function my_pmprorh_init()
{
//don't break if Register Helper is not loaded
if(!function_exists( 'pmprorh_add_registration_field' )) {
return false;
}
//define the fields
$fields = array();
$fields[] = new PMProRH_Field(
@amboutwe
amboutwe / yoast_seo_opengraph_change_image_size.php
Last active Oct 18, 2021
Code snippet to change or remove OpenGraph output in Yoast SEO. There are multiple snippets in this code.
View yoast_seo_opengraph_change_image_size.php
<?php
/********* DO NOT COPY THE PARTS ABOVE THIS LINE *********/
/* Change size for Yoast SEO OpenGraph image for all content
* Credit: Yoast Development team
* Last Tested: May 19 2020 using Yoast SEO 14.1 on WordPress 5.4.1
* Accepts WordPress reserved image size names: 'thumb', 'thumbnail', 'medium', 'large', 'post-thumbnail'
* Accepts custom image size names: https://developer.wordpress.org/reference/functions/add_image_size/
*/
@strangerstudios
strangerstudios / is_user_logged_in_required.php
Last active Apr 3, 2020
Make PMPro Register Helper fields required for logged out users only.
View is_user_logged_in_required.php
if(is_user_logged_in())
$required = false;
else
$required = true;
$fields[] = new PMProRH_Field(
"company", // input name, will also be used as meta key
"text", // type of field
array(
"size"=>40, // input size
@jackie
jackie / breakpoints.json
Last active Dec 19, 2015
Sass Script function to get breakpoint values from a JSON file.
View breakpoints.json
{
"phone" : "all and (max-width: 603px)",
"desktop": "all and (min-width: 1025px)",
"tablet" : "all and (min-width: 604px) and (max-width: 1024px)"
}
View dev-tool-resources.html
// Paul Irish talking about Chrome DevTools Timeline's new Frame Mode
http://www.youtube.com/watch?v=Vp524yo0p44
// Chrome Office Hours - troubleshooting paint times
http://www.youtube.com/watch?v=z0_jD8nO5Zw
// Break time to glass - youtube
http://youtu.be/Il4swGfTOSM
// Avoiding Unnecessary Paints
View ie8-grid-foundation-4.css
/* The Grid ---------------------- */
.lt-ie9 .row { width: 940px; max-width: 100%; min-width: 768px; margin: 0 auto; }
.lt-ie9 .row .row { width: auto; max-width: none; min-width: 0; margin: 0 -15px; }
.lt-ie9 .row.large-collapse .column,
.lt-ie9 .row.large-collapse .columns { padding: 0; }
.lt-ie9 .row .row { width: auto; max-width: none; min-width: 0; margin: 0 -15px; }
.lt-ie9 .row .row.large-collapse { margin: 0; }
.lt-ie9 .column, .lt-ie9 .columns { float: left; min-height: 1px; padding: 0 15px; position: relative; }
.lt-ie9 .column.large-centered, .columns.large-centered { float: none; margin: 0 auto; }
@malarkey
malarkey / Contract Killer 3.md
Last active Nov 18, 2021
The latest version of my ‘killer contract’ for web designers and developers
View Contract Killer 3.md

When times get tough and people get nasty, you’ll need more than a killer smile. You’ll need a killer contract.

Used by 1000s of designers and developers Clarify what’s expected on both sides Helps build great relationships between you and your clients Plain and simple, no legal jargon Customisable to suit your business Used on countless web projects since 2008

…………………………

@strangerstudios
strangerstudios / gist:1389944
Created Nov 23, 2011
Paid Memberships Pro Extra Checkout/Profile Fields Example
View gist:1389944
<?php
/*
Adding First and Last Name to Checkout Form
*/
//add the fields to the form
function my_pmpro_checkout_after_password()
{
if(!empty($_REQUEST['firstname']))
$firstname = $_REQUEST['firstname'];