Skip to content

Instantly share code, notes, and snippets.

View robbiegod's full-sized avatar
🧛‍♂️

Robert Fletcher robbiegod

🧛‍♂️
View GitHub Profile
@robbiegod
robbiegod / licence activation.php
Created December 5, 2019 21:33 — forked from mattradford/licence activation.php
ACF5 Pro licence activation. Could be adapted for any other plugin that requires a licence key, but doesn't yet support defining it in wp-config. Fires on theme activation.
// Place this in wp-config
define( 'ACF_5_KEY', 'yourkeyhere' );
// Set ACF 5 license key on theme activation. Stick in your functions.php or equivalent.
function auto_set_license_keys() {
if ( ! get_option( 'acf_pro_license' ) && defined( 'ACF_5_KEY' ) ) {
$save = array(
'key' => ACF_5_KEY,
@robbiegod
robbiegod / imagick_average_colour.php
Last active May 9, 2018 19:28 — forked from paulferrett/imagick_average_colour.php
This function will get the average colour of an image file using PHP and Image Magick using the IMagick extension.
<?php
/**
* Get the average pixel colour from the given file using Image Magick
*
* @param string $filename
* @param bool $as_hex Set to true, the function will return the 6 character HEX value of the colour.
* If false, an array will be returned with r, g, b components.
*/
function get_average_colour($filename, $as_hex_string = true) {
@robbiegod
robbiegod / rest_insert_post.php
Created April 16, 2018 15:32 — forked from andrewahead4/rest_insert_post.php
A simple post insert using WP REST API and PHP over basic authentication
<?php
///////////////////////////////////////////////////////////////////////////////////
// //
// This is using a sample local WordPress Install and is not production safe //
// It uses the REST and Basic Auth plugins //
// //
///////////////////////////////////////////////////////////////////////////////////
<?php
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
class Skubbs_Post_Types {
public static function init() {
add_action( 'init', array( __CLASS__, 'register_post_types' ), 5 );
<%@ WebHandler Language="C#" Debug="true" Class="name" %>
using System.Web;
public class name : IHttpHandler {
public void ProcessRequest (HttpContext context) {
}
@robbiegod
robbiegod / config.json
Created November 24, 2015 16:18 — forked from anonymous/config.json
Bootstrap Customizer Config
{
"vars": {
"@gray-darker": "lighten(#000, 13.5%)",
"@gray-dark": "lighten(#000, 20%)",
"@gray": "lighten(#000, 33.5%)",
"@gray-light": "lighten(#000, 46.7%)",
"@gray-lighter": "lighten(#000, 93.5%)",
"@brand-primary": "#428bca",
"@brand-success": "#5cb85c",
"@brand-info": "#5bc0de",
@robbiegod
robbiegod / .gitignore
Created October 5, 2015 16:28 — forked from salcode/.gitignore
.gitignore file for WordPress - Bare Minimum Git
# -----------------------------------------------------------------
# .gitignore for WordPress
# Bare Minimum Git
# http://ironco.de/bare-minimum-git/
# ver 20150227
#
# This file is tailored for a WordPress project
# using the default directory structure
#
# This file specifies intentionally untracked files to ignore