Skip to content

Instantly share code, notes, and snippets.

Avatar

Theuns Coetzee ipokkel

View GitHub Profile
@ipokkel
ipokkel / divicheck.php
Last active Aug 10, 2017
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.
View divicheck.php
<?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 Oct 8, 2017 — forked from jareware/SCSS.md
Advanced SCSS, or, 16 cool things you may not have known your stylesheets could do
View SCSS.md

⇐ 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 Oct 8, 2017 — forked from garyharan/_mixins.scss
Useful scss mixins (rounded corners, gradients, text-field, button)
View _mixins.scss
@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 Nov 4, 2017
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.
View ET-VS-CALDERA-RATY.JS.MD

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 — forked from ain/Array.prototype.compare.js
JavaScript compare() method for Array
View Array.prototype.compare.js
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 Feb 27, 2019
PMPro Customization: Register Helper - Add date of birth date picker to checkout
View pmpro-customizations.php
<?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-register-helper-example.php
Created Feb 28, 2019
Custom Fields for Register Helper with JQuery Datepicker
View pmpro-customizations-register-helper-example.php
<?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 Feb 28, 2019
Custom Fields for Register Helper with conditional and date.
View pmpro-customizations-register-helper-example.php
<?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.php
Last active Feb 28, 2019
PMPro Customization: Register Helper - Add JQuery widget date of birth date picker to checkout
View pmpro-customizations.php
<?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 Feb 28, 2019
Override the text string "Check" with your own custom string on the confirmation and invoice pages of Paid Memberships Pro.
View confirmation.php
<?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';
*/
You can’t perform that action at this time.