Skip to content

Instantly share code, notes, and snippets.

View j-cam's full-sized avatar

Jamie Campbell j-cam

View GitHub Profile
<?php
if ( !function_exists( 'get_home_path' ) )
require_once( dirname(__FILE__) . '/../../../wp-admin/includes/file.php' );
add_action( 'admin_init', array(&$this, 'has_acf') );
public function has_acf() {
if ( is_admin() && current_user_can( 'activate_plugins' ) && !is_plugin_active( 'advanced-custom-fields-pro/acf.php' ) ) {
add_action( 'admin_notices', array(&$this, 'acf_not_activated_notice') );
@j-cam
j-cam / SassMeister-input.scss
Last active April 20, 2017 19:16
3 Grid Columns with one in the middle that's wider than the others (Generated by SassMeister.com)
// ----
// Sass (v3.4.21)
// Compass (v1.0.3)
// ----
// Three Columns with one that is wider than the others
$module: 'unequal-columns';
.#{$module} {
// Module Variables: contexts from a PSD design file
page-hero:
headline: |-
<span>Even A SMALL amount of retained blood can cause serious complications.</span>
<strong>1 in 5 patients develop Retained Blood Syndrome (RBS) after heart surgery.</strong>
image: "assets/img/hero-rbs-home.jpg"
button-text: LEARN MORE ABOUT RBS
@j-cam
j-cam / scss.json
Created April 29, 2018 16:37
VS Code User Snippets SCSS: add @ directives.
{
"@import directive": {
"prefix": "@import",
"body": [
"@import "
],
"description": "import scss/sass partial"
},
"@include directive": {
"prefix": "@include",
@j-cam
j-cam / jquery.fancybox-1.3.4_patch.js
Last active July 17, 2018 17:40
Fancybox v1.3.4 compatibility patch for jQuery > v1.8.3
// Source References
// - SO: https://stackoverflow.com/a/14344290/538696
// - picssel.com: http://www.picssel.com/playground/jquery/fancybox/jquery.fancybox-1.3.4_patch.zip
// - GH: https://github.com/nvidoni/fancybox/issues/2#issuecomment-255766623
/*
* FancyBox - jQuery Plugin
* Simple and fancy lightbox alternative
*
* Examples and documentation at: http://fancybox.net
*