Skip to content

Instantly share code, notes, and snippets.

@stefancrowe
stefancrowe / functions.php
Created January 17, 2019 12:16
WordPress Advanced Custom Fields - Organise Field Groups into categories with sort
/**
* Add support for Field Group categories to Advanced Custom Fields (WordPress plugin).
*
* Drop this code into your theme's functions.php or equivalent file. This will
* then allow you to add categories to Field Groups on the edit screen. It also
* adds a "Category" column to the Field Groups list page - users can click
* on the category name to filter the Field Groups by that category.
*
* @author Stefan Crowe <me@stefancrowe.co.uk>
*/
@stefancrowe
stefancrowe / gulpfile.js
Created December 8, 2016 09:28
Gulp Task to generate a JSON array of Font Awesome 4.* icons from the package
require('fs');
require('gulp');
/**
* Create JSON array of icons from Font Awesome _icons.scss (based on v4.*).
* Replace PATH_TO_FONT_AWESOME and PATH_TO_SAVE with your relevant paths.
*/
gulp.task('icons', function() {
// Pattern to only match the icon name (excluding "fa-")
var re = /^.\#\{\$fa\-css\-prefix\}\-([a-z0-9\-]*)\:before { content: \$fa\-var\-[a-z0-9\-]*\; }$/gmi;