Skip to content

Instantly share code, notes, and snippets.

Jörn Lund mcguffin

Block or report user

Report or block mcguffin

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View 000-fix-core-42656.php
<?php
/*
Plugin Name: Fix core issue 42656
Description: Fix PHP Warning undefined index pagenow on login popup. Place this into wp-content/mu-plugins/
Author: McGuffin
Author URI: http://github.org/mcguffin
Version: 0.0.1
*/
@mcguffin
mcguffin / acf-quick-edit-rgba-color-picker.php
Last active Oct 10, 2019
ACF RGBA Color Picker + ACF Quick Edit Fields
View acf-quick-edit-rgba-color-picker.php
<?php
/**
* Bringing ACF RGBA Color Picker and ACF QuickEdit Fields together.
* https://github.com/mcguffin/acf-quick-edit-fields
* https://wordpress.org/plugins/acf-rgba-color-picker/
*/
/**
* Add field support
*/
View acf-nested-repeater.json
[
{
"key": "group_5a3593ed877c0",
"title": "Nested Repeaeter",
"fields": [
{
"key": "field_5a3593f76e021",
"label": "Outer",
"name": "outer",
"type": "repeater",
@mcguffin
mcguffin / .htaccess
Last active Feb 27, 2019
1und1: Cachify .htaccess for ssl enabled sites
View .htaccess
# BEGIN CACHIFY
<IfModule mod_rewrite.c>
# ENGINE ON
RewriteEngine on
RewriteBase /
# set hostname directory
RewriteCond %{HTTPS} on
RewriteRule .* - [E=CACHIFY_HOST:https-%{HTTP_HOST}]
RewriteCond %{HTTPS} off
@mcguffin
mcguffin / git-release.py
Last active Nov 13, 2019
Python script to create GitHub release
View git-release.py
#!/usr/bin/env python3
import argparse, glob, json, re, subprocess, urllib.request, os, sys
class version_number:
major=0
minor=0
release=0
@mcguffin
mcguffin / git-release
Last active Oct 1, 2019
Shell script to create GitHub release
View git-release
#!/bin/bash
MESSAGE="0"
VERSION="0"
DRAFT="false"
PRE="false"
BRANCH="master"
GITHUB_ACCESS_TOKEN="<YOUR_ACCESS_TOKEN>"
# get repon name and owner
@mcguffin
mcguffin / .htaccess
Last active Aug 29, 2018
Generic Cachify .htaccess for ssl enabled sites
View .htaccess
# BEGIN CACHIFY
<IfModule mod_rewrite.c>
# ENGINE ON
RewriteEngine on
RewriteBase /
# set hostname directory
RewriteCond %{HTTPS} on
RewriteRule .* - [E=CACHIFY_HOST:https-%{HTTP_HOST}]
@mcguffin
mcguffin / polylang-fix-acf-relational.php
Created Oct 26, 2015
Polylang: Fix missing value on ACF relational fields
View polylang-fix-acf-relational.php
<?php
/*
Plugin Name: Polylang: Fix missing value on ACF relational fields
Plugin Description: ACF relational Field value for translated posts types where not displayed when Admin langauge differs from post language.
Author: Jörn Lund
Author URI: http://github.org/mcguffin
Version: 0.0.1
*/
@mcguffin
mcguffin / generate-ratio-grid.php
Last active Aug 29, 2015
Generate SASS code for fixed aspect ratio layout grid.
View generate-ratio-grid.php
<?php
/* Copyright 2015 Jörn Lund https://github.com/mcguffin/
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2, as
published by the Free Software Foundation.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
@mcguffin
mcguffin / comment-form.php
Created Mar 23, 2015
WP-Recaptcha-Integration: A working custom comment form.
View comment-form.php
<form action="<?php echo get_option('siteurl'); ?>/wp-comments-post.php" method="post" id="commentform">
<?php if (is_user_logged_in()) : ?>
<p>
<?php printf(__('Logged in as <a href="%s/wp-admin/profile.php">%s</a>.', 'shoestrap'), get_option('siteurl'), $user_identity); ?>
<a href="<?php echo wp_logout_url(get_permalink()); ?>" title="<?php __('Log out of this account', 'shoestrap'); ?>"><?php _e('Log out &raquo;', 'shoestrap'); ?></a>
</p>
<?php else : ?>
<div class="form-group">
<label for="author"><?php _e('Name', 'shoestrap'); if ($req) _e(' (required)', 'shoestrap'); ?></label>
<input type="text" class="form-control" name="author" id="author" value="<?php echo esc_attr($comment_author); ?>" size="22" <?php if ($req) echo 'aria-required="true"'; ?>>
You can’t perform that action at this time.