Skip to content

Instantly share code, notes, and snippets.

View sc0ttkclark's full-sized avatar
🍕
Working hard reviewing and deploying code

Scott Kingsley Clark sc0ttkclark

🍕
Working hard reviewing and deploying code
View GitHub Profile
@sc0ttkclark
sc0ttkclark / my-pmpro-redirect-to-referring-page-after-checkout.md
Last active June 6, 2022 12:44 — forked from ipokkel/my-pmpro-redirect-to-referring-page-after-checkout.php
Redirect new members and existing members that changes their existing level back to the referring page after checkout.

Some users reported the recipe not redirecting to the referer after checkout.

Updated the my_pmpro_redirect_to_referring_page_after_checkout_track function that sets the cookie here: ipokkel/32d6ba9425d4550a5861709498e00135

@sc0ttkclark
sc0ttkclark / my-pmpro-event-tickets-visibility.php
Created January 10, 2022 22:51
Restrict access to specific tickets / RSVPs depending on Membership Level. Requires Event Tickets 5.2.3+
<?php
/**
* Restrict access to specific tickets / RSVPs depending on Membership Level.
*
* Requires Event Tickets 5.2.3+
*
* You can add this recipe to your site by creating a custom plugin
* or using the Code Snippets plugin available for free in the WordPress repository.
* Read this companion article for step-by-step directions on either method.
* https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
@sc0ttkclark
sc0ttkclark / example-attendees-orm-01-get-attendees.php
Last active May 18, 2022 03:27
Event Tickets Attendees ORM examples
<?php
/*
* Get a list of attendees.
*/
// Set the provider. This can be default (all attendees of any type), tribe-commerce, rsvp, woo, or edd.
$provider = 'default';
// Get the ORM object set up.
@sc0ttkclark
sc0ttkclark / my-pmpro-set-user-display-name-as-first-last-name.php
Last active March 11, 2022 20:56
Automatically update the display name to be set as the first/last name when the user is registered or the profile is saved or during checkout.
<?php
/**
* Automatically update the display name to be set as the first/last name when the user is registered or the profile is saved.
*
* You can add this recipe to your site by creating a custom plugin
* or using the Code Snippets plugin available for free in the WordPress repository.
* Read this companion article for step-by-step directions on either method.
* https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
*/
@sc0ttkclark
sc0ttkclark / my-pmpro-reset-cron-schedules.php
Last active March 11, 2022 17:18
Reset the Cron Schedules for Paid Memberships Pro. The single-use version can be found at: https://gist.github.com/sc0ttkclark/bd319a47656b786ccee3eca6f2dc4a9a
<?php
/**
* Reset the Cron Schedules for Paid Memberships Pro.
*
* You can add this recipe to your site by creating a custom plugin
* or using the Code Snippets plugin available for free in the WordPress repository.
* Read this companion article for step-by-step directions on either method.
* https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
*/
@sc0ttkclark
sc0ttkclark / my-pmpro-reset-cron-schedules-full.php
Created March 2, 2022 15:26
Reset the Cron Schedules for Paid Memberships Pro. The single-use version can be found at: https://gist.github.com/sc0ttkclark/bd319a47656b786ccee3eca6f2dc4a9a and the PMPro admin page only version can be found at: https://gist.github.com/sc0ttkclark/e11691d6c5a278662e3c694a0bb12e5a
<?php
/**
* Reset the Cron Schedules for Paid Memberships Pro on any page load.
*
* You can add this recipe to your site by creating a custom plugin
* or using the Code Snippets plugin available for free in the WordPress repository.
* Read this companion article for step-by-step directions on either method.
* https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
*/
@sc0ttkclark
sc0ttkclark / my-pmpro-reset-cron-schedules-single-use.php
Last active February 23, 2022 17:37
Reset the Cron Schedules for Paid Memberships Pro (single-use run with Code Snippets plugin). The solution that runs on every PMPro Admin page load can be found here: https://gist.github.com/sc0ttkclark/e11691d6c5a278662e3c694a0bb12e5a
<?php
/**
* Reset the Cron Schedules for Paid Memberships Pro (single-use run with Code Snippets plugin).
*
* You can add this recipe to your site by creating a custom plugin
* or using the Code Snippets plugin available for free in the WordPress repository.
* Read this companion article for step-by-step directions on either method.
* https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
*/
@sc0ttkclark
sc0ttkclark / wordpress-plugins-saved-replies.user.js
Created February 9, 2022 17:06
WordPress.org plugins and themes topic saved replies Tampermonkey script. Click 'raw' to install it.
// ==UserScript==
// @name WordPress.org plugins and themes topic saved replies
// @namespace https://skc.dev/
// @version 0.1
// @description Add saved replies to topic reply forms.
// @author Scott Kingsley Clark
// @match https://wordpress.org/support/topic/*
// @match https://*.wordpress.org/support/topic/*
// @grant none
// ==/UserScript==
@sc0ttkclark
sc0ttkclark / my-pmpro-site-lock-down.php
Last active February 2, 2022 15:50
Lock the entire PMPro site down for anyone logged out.
<?php
/*
* Lock down the site for anyone logged out.
*
* You can add this recipe to your site by creating a custom plugin
* or using the Code Snippets plugin available for free in the WordPress repository.
* Read this companion article for step-by-step directions on either method.
* https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
*/
@sc0ttkclark
sc0ttkclark / pmpro-disable-email-html-cleanup.php
Last active January 31, 2022 18:07
This recipe will disable the HTML removal from email templates when using unsupported tags.
<?php // do not copy this line.
/**
* This recipe will disable the HTML removal from email templates when using unsupported tags.
*
* You can add this recipe to your site by creating a custom plugin
* or using the Code Snippets plugin available for free in the WordPress repository.
* Read this companion article for step-by-step directions on either method.
* https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
*/