Skip to content

Instantly share code, notes, and snippets.

View felixarntz's full-sized avatar

Felix Arntz felixarntz

View GitHub Profile
@felixarntz
felixarntz / google-site-kit-anonymize-ips.php
Last active August 25, 2021 17:02
WordPress mini plugin as an extension to Site Kit that ensures the inserted Google Analytics snippet anonymizes IP addresses.
<?php
/**
* Site Kit by Google Anonymize IPs plugin file.
*
* @package Google\Site_Kit_Anomyize_IPs
* @author Felix Arntz, Google
* @license GPL-2.0-or-later
* @copyright 2019 Google Inc.
*
* @wordpress-plugin
@felixarntz
felixarntz / amp-image-lightbox-links.php
Created August 12, 2019 09:57
WordPress mini plugin for AMP that transforms all images linking to themselves to open in an `amp-image-lightbox` overlaying the website content. For docs on the component, see https://amp.dev/documentation/components/amp-image-lightbox/
@felixarntz
felixarntz / wp-plugin-mu-loader.php
Last active October 10, 2022 12:21
WP Plugin MU Loader
<?php
/**
* Plugin initialization file
*
* @package WP_Plugin_MU_Loader
* @since 1.0.0
*
* @wordpress-plugin
* Plugin Name: WP Plugin MU Loader
* Plugin URI: https://gist.github.com/felixarntz/daff4006112b60dfea677ca08fc0b31c
@felixarntz
felixarntz / wp-alignment-classes.css
Created November 24, 2017 15:52
New WordPress alignment classes introduced by Gutenberg
/* -------------------------------------------------------------
# Variables
------------------------------------------------------------- */
$site_maxwidth: 72rem; // Maximum width the entire site should not exceed
$site_maxwidth-text: 40rem; // Maximum width the main content text should not exceed
$spacing_horizontal: 1rem; // General horizontal padding
/* -------------------------------------------------------------
# General Styles
@felixarntz
felixarntz / edd-no-default-gateway.php
Last active January 22, 2018 13:48
Mini plugin to allow specifying no default gateway in Easy Digital Downloads.
<?php
/**
* Mini plugin to allow specifying no default gateway in Easy Digital Downloads.
*
* @package EDDNoDefaultGateway
* @since 1.0.0
*
* @wordpress-plugin
* Plugin Name: EDD No Default Gateway
* Plugin URI: https://gist.github.com/felixarntz/f9ada0ffb92d6b2e880c7dd0f826b486
@felixarntz
felixarntz / uam-add-user-groups-by-default.php
Created September 16, 2017 10:35
User Access Manager: Add user groups by default
<?php
function uam_activate_user_groups_by_default( $post_id, $post = null, $update = false ) {
global $userAccessManager;
if ( ! is_object( $userAccessManager ) ) {
return;
}
if ( $update ) {
@felixarntz
felixarntz / fixed-edit-sidebar.php
Created August 17, 2017 14:16
Fixed Edit Sidebar
<?php
/*
Plugin Name: Fixed Edit Sidebar
Plugin URI: https://gist.github.com/felixarntz/5b1ad2a72dc22053c07812340daf3274
Description: Allows the sidebar in the post editing screen to scroll along if the screen is large enough.
Version: 1.0.0
Author: Felix Arntz
Author URI: https://leaves-and-love.net
License: GNU General Public License v2
License URI: http://www.gnu.org/licenses/gpl-2.0.html
@felixarntz
felixarntz / wp-scoped-mu-plugin-loader.php
Last active August 10, 2017 10:21
WP Scoped MU Plugin Loader
<?php
/*
Plugin Name: WP Scoped MU Plugin Loader
Plugin URI: https://gist.github.com/felixarntz/9b3bed66099641a45ce437b067fea547
Description: Loads scoped MU plugins for specific sites or networks for an improved organization of those more specific tweaks.
Version: 1.0.0
Author: Felix Arntz
Author URI: https://leaves-and-love.net
License: GNU General Public License v2
License URI: http://www.gnu.org/licenses/gpl-2.0.html
@felixarntz
felixarntz / multisite-recap-boilerplate.txt
Created June 23, 2017 13:32
Multisite Recap Post Boilerplate
Post Title:
Multisite Recap for the week of {F jS (month + day)}
-----------------------------
Post Content:
<h2>Office Hours Recap</h2>
The <a href="https://make.wordpress.org/core/{Y}/{m}/{d}/multisite-agenda-for-the-week-of-{F}-{jS}/">agenda for this office hours meeting</a> included/was {(brief one-sentence description of original meeting agenda)}.
@felixarntz
felixarntz / multisite-agenda-boilerplate.txt
Last active June 27, 2017 16:12
Multisite Agenda Post Boilerplate
Post Title:
Multisite Agenda for the week of {F jS (month + day)}
-----------------------------
Post Content:
<h2>Office Hours Agenda</h2>
This is the agenda for the weekly office hours meeting on [time relative]Tuesday 16:00 UTC[/time] in <a href="https://wordpress.slack.com/archives/core-multisite">#core-multisite</a>.