Skip to content

Instantly share code, notes, and snippets.

View ipokkel's full-sized avatar

Theuns Coetzee ipokkel

View GitHub Profile
@ipokkel
ipokkel / divicheck.php
Last active August 10, 2017 04:49
Wordpress 3rd party depency checks. Verify that a specific theme, child theme or plugin is installed and active. This snippet checks wheter the Divi theme, Divi child theme or Divi Builder plugin is installed.
<?php
/**
* @version 1.0.0
* @author Theuns Coetzee (pokkel/ipokkel)
* @link http://www.theunscoetzee.com
*/
/**
* @param checkstatus( string, bool )
* Accepts string and boolean argument
@ipokkel
ipokkel / SCSS.md
Created October 8, 2017 10:15 — forked from jareware/SCSS.md
Advanced SCSS, or, 16 cool things you may not have known your stylesheets could do

⇐ back to the gist-blog at jrw.fi

Advanced SCSS

Or, 16 cool things you may not have known your stylesheets could do. I'd rather have kept it to a nice round number like 10, but they just kept coming. Sorry.

I've been using SCSS/SASS for most of my styling work since 2009, and I'm a huge fan of Compass (by the great @chriseppstein). It really helped many of us through the darkest cross-browser crap. Even though browsers are increasingly playing nice with CSS, another problem has become very topical: managing the complexity in stylesheets as our in-browser apps get larger and larger. SCSS is an indispensable tool for dealing with this.

This isn't an introduction to the language by a long shot; many things probably won't make sense unless you have some SCSS under your belt already. That said, if you're not yet comfy with the basics, check out the aweso

@ipokkel
ipokkel / _mixins.scss
Created October 8, 2017 22:07 — forked from garyharan/_mixins.scss
Useful scss mixins (rounded corners, gradients, text-field, button)
@mixin box-shadow($top, $left, $blur, $color, $inset: false) {
@if $inset {
-webkit-box-shadow:inset $top $left $blur $color;
-moz-box-shadow:inset $top $left $blur $color;
box-shadow:inset $top $left $blur $color;
} @else {
-webkit-box-shadow: $top $left $blur $color;
-moz-box-shadow: $top $left $blur $color;
box-shadow: $top $left $blur $color;
}
@ipokkel
ipokkel / ET-VS-CALDERA-RATY.JS.MD
Last active November 4, 2017 12:16
Elegant Theme's Extra theme has conflicts with Caldera Form's newer version of raty.js. Removed raty.js v2.6.0 from the Caldera Plugin so it uses the older v2.5.2 called by Extra. The star rating in Caldera form still works and is backwards compatable while the Extra is not compatable with the newer version in Caldera.

RATY.JS COMPATIBILITY CONFLICT BETWEEN ELEGANT THEMES' EXTRA THEME & CALDERA FORMS

DATE: 2017-11-04

PROBLEM

Whenever a Caldera Form is present on a post or page the Extra theme's post rating stars dissappears.

SOLUTION (TEMPORARY HACK)

@ipokkel
ipokkel / Array.prototype.compare.js
Created May 10, 2018 14:42 — forked from ain/Array.prototype.compare.js
JavaScript compare() method for Array
Array.prototype.compare = function(array) {
if (!array) {
return false;
}
if (this.length !== array.length) {
return false;
}
for (var i = 0, l = this.length; i < l; i++) {
if (this[i] instanceof Array && array[i] instanceof Array) {
if (!this[i].compare(array[i])) {
@ipokkel
ipokkel / pmpro-customizations.php
Last active February 27, 2019 18:07
PMPro Customization: Register Helper - Add date of birth date picker to checkout
<?php
/**
* PMPro Customization: Register Helper - Add date of birth date picker to checkout
*/
//we have to put everything in a function called on init, so we are sure Register Helper is loaded
function my_pmprorh_init()
{
//don't break if Register Helper is not loaded
@ipokkel
ipokkel / pmpro-customizations.php
Last active February 28, 2019 12:17
PMPro Customization: Register Helper - Add JQuery widget date of birth date picker to checkout
<?php
/*
Plugin Name: PMPro Customizations
Plugin URI: https://www.paidmembershipspro.com/wp/pmpro-customizations/
Description: Customizations for my Paid Memberships Pro Setup
Version: .1
Author: Paid Memberships Pro
Author URI: https://www.paidmembershipspro.com
*/
@ipokkel
ipokkel / pmpro-customizations-register-helper-example.php
Created February 28, 2019 00:11
Custom Fields for Register Helper with JQuery Datepicker
<?php
/*
Plugin Name: PMPro Customizations
Plugin URI: https://www.paidmembershipspro.com/wp/pmpro-customizations/
Description: Customizations for my Paid Memberships Pro Setup
Version: .1
Author: Paid Memberships Pro
Author URI: https://www.paidmembershipspro.com
*/
@ipokkel
ipokkel / pmpro-customizations-register-helper-example.php
Created February 28, 2019 00:46
Custom Fields for Register Helper with conditional and date.
<?php
/*
Plugin Name: PMPro Customizations
Plugin URI: https://www.paidmembershipspro.com/wp/pmpro-customizations/
Description: Customizations for my Paid Memberships Pro Setup
Version: .1
Author: Paid Memberships Pro
Author URI: https://www.paidmembershipspro.com
*/
@ipokkel
ipokkel / confirmation.php
Created February 28, 2019 23:14
Override the text string "Check" with your own custom string on the confirmation and invoice pages of Paid Memberships Pro.
<?php
/**
* Create a subdirectory named "pages" in the pmpro-customizations plugin folder
* e.g. "your/site/directory/wp-content/plugins/pmpro-customizations/pages"
* place this custom confirmation.php inside the "pages" folder you created
* Change the text, Cheque/Bank Transfer, wrapped inside the inverted commas
* to your preferred text string.
* e.g. $my_text_string_for_check_payments = 'Pay by Cheque or Cash';
*/