Skip to content

Instantly share code, notes, and snippets.

View rtpHarry's full-sized avatar
Focusing on learning something every day

Matthew Harris rtpHarry

Focusing on learning something every day
View GitHub Profile
rtpHarry / gist:6e1d73d026fca369569f11798736dc7a
Last active October 14, 2022 22:41 — forked from felixzapata/gist:9144986
How to create a clone role in WordPress
View gist:6e1d73d026fca369569f11798736dc7a
* Clone the subscriber role to create a tenant role
* Note: this only needs to be run once, so it can be removed after the role is created
function clone_subscriber_to_tenant() {
$new_role = 'tenant';
$new_role_name = 'Tenant';
$source_role = 'subscriber';
rtpHarry / WordPress Google Analytics
Last active March 16, 2019 21:31 — forked from kenhowardpdx/WordPress Google Analytics
Add Google Analytics to WordPress Theme functions.php
View WordPress Google Analytics
// originally based on
// updated to current gtag.js snippet and moved to head
function rtp_init_analytics() {
$analytics_id = 'YOUR UA CODE HERE';
$analytics = '<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="'. $analytics_id .'"></script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}