Skip to content

Instantly share code, notes, and snippets.


Gary Swift GarySwift

  • Waterford City, Ireland
View GitHub Profile
GarySwift / acf-php-to-json.php
Created Sep 24, 2020 — forked from ollietreend/acf-php-to-json.php
Convert Advanced Custom Fields Pro configuration from PHP to JSON.
View acf-php-to-json.php
* Plugin Name: Convert ACF PHP to JSON
* Description: Convert Advanced Custom Fields Pro configuration from PHP to JSON.
namespace ConvertAcfPhpToJson;
* Add submenu item under 'Custom Fields'
GarySwift / register-post-type.php
Created Jan 21, 2020 — forked from justintadlock/register-post-type.php
Help file when registering post types.
View register-post-type.php
# Register custom post types on the 'init' hook.
add_action( 'init', 'my_register_post_types' );
* Registers post types needed by the plugin.
* @since 1.0.0
* @access public
GarySwift /
Last active Jan 14, 2020
Hack to fix 'Undefined index: key' bug
GarySwift /
Last active Nov 13, 2019
Easily add sass and webpack support for WordPress plugins created using

Add Sass and Webpack Support for WordPress plugins

This is for when you use the WordPress Plugin Boilerplate generator as starter for a WordPress plugin.

This is a way to get Sass set up and have Javascript use module dependency with webpack as the module bundler.

Follow the steps below to get started.



Icomoon Font Packs

These notes are a quick reminder to myself about how to install and how to update an Icomoon font pack.

How to include in a FoundationPress project

GarySwift / gist:b5cf408c30257dd7efc3c8cae633e0cd
Last active May 25, 2018 — forked from pitch-gist/gist:2999707
HTML: Simple Maintenance Page
View gist:b5cf408c30257dd7efc3c8cae633e0cd
<!DOCTYPE html>
<html lang="en">
<meta charset="UTF-8">
<title>Site Maintenance</title>
body { text-align: center; padding: 150px; }
h1 { font-size: 50px; }
body { font: 20px Helvetica, sans-serif; color: #333; }
article { display: block; text-align: left; width: 650px; margin: 0 auto; }
GarySwift / custom_menu_admin.php
Last active May 22, 2018 — forked from carlodaniele/custom_menu_admin.php
A basic plugin showing how to add menu metaboxes to admin menu page
View custom_menu_admin.php
* @package Custom_menu_admin
* @version 1.0
Plugin Name: Custom menu admin
Plugin URI:
Description: This is an example plugin
Author: Carlo Daniele
GarySwift / _buttons.php
Last active May 21, 2018
Skew button group experiment for Zurb Foundation
View _buttons.php
<div class="button-group skew">
<div class="button-wrap one"><a href="#" class="button button-one">Book Now</a></div><!--
--><div class="button-wrap two"><a href="#" class="button button-two">More Info</a></div>
GarySwift /
Last active May 10, 2018
Get WordPress content - various ways
GarySwift / _fucntions.php
Created May 9, 2018
Unfinished notes for saving ACF field groups into post content. #WordPress #ACF
View _fucntions.php
if ( ! function_exists('write_log')) {
function write_log ( $log ) {
if ( is_array( $log ) || is_object( $log ) ) {
error_log( print_r( $log, true ) );
} else {
error_log( $log );
You can’t perform that action at this time.