Skip to content

Instantly share code, notes, and snippets.

View thefrosty's full-sized avatar
🏖️
Santa Monica WordPress Developer

Austin Passy thefrosty

🏖️
Santa Monica WordPress Developer
View GitHub Profile
@thefrosty
thefrosty / freemius.php
Created January 12, 2024 17:39
Create an override function, as to bypass Freemius in some less than smart plugins.
<?php
declare(strict_types=1);
/**
* Create an override function, as to bypass Freemius in stupid plugins.
* @wordpress-muplugin
* Plugin Name: Freemius Killer
* Description: Global override for Freemius' "loader".
* Version: 1.0.0
<?php
declare(strict_types=1);
/**
* Remove global headers added by The Events Calendar.
* @wordpress-muplugin
* Plugin Name: TEC Remove Headers
* Description: Remove global headers added by The Events Calendar.
* Version: 1.0.0
@thefrosty
thefrosty / deploy.yml
Created November 22, 2023 18:51
GitHub Action Workflow
name: "Deploy to Linode"
on:
push:
branches:
- master
workflow_dispatch:
jobs:
tag:
@thefrosty
thefrosty / post-requirements.js
Created March 1, 2022 20:04
Require Post Title for Custom Post Type(s)
/** global jQuery */
(function ($) {
'use strict'
const requirements = {
$title: $('#title')
}
/**
* Initiate.
@thefrosty
thefrosty / app-passwords-client-demo.php
Last active January 23, 2021 21:05 — forked from TimothyBJacobs/app-passwords-client-demo.php
App Passwords Client Demo Plugin
<?php declare(strict_types=1);
/**
* Plugin Name: Demo App Passwords Client
*/
namespace TimothyBJacobs\AppPasswordsClientDemo;
const META_KEY = '_app_passwords_client_demo_creds';
const PAGE = 'app-passwords-demo';
@thefrosty
thefrosty / get-post-by-slug.php
Last active June 5, 2020 15:11
Validate REST API requests by slug, and set proper response 404 status when not found.
<?php declare(strict_types=1);
/**
* Get Post By Slug
* @wordpress-plugin
* Plugin Name: Not Found Posts by Slug to 404
* Description: Validate REST API requests by slug, and set proper response 404 status when not found.
* Author: Austin Passy
* Author URI: https://github.com/thefrosty
* Version: 1.0.0
@thefrosty
thefrosty / WordPress md5 shortcode
Created August 6, 2012 21:27
Get the md5 hash of an email for gravatar or other purposes.
add_shortcode( 'md5', 'md5_email_hash' );
function md5_email_hash( $atts ) {
extract( shortcode_atts( array(
'hash' => '',
), $atts ) );
$hash = ( isset( $_GET['email'] ) && !empty( $_GET['email'] ) ) ? $_GET['email'] : $hash;
$hash = is_email( $hash ) ? sanitize_email( strtolower( $hash ) ) : trim( $hash );
@thefrosty
thefrosty / mailhog-mamp.md
Created June 27, 2018 00:44 — forked from jaredatch/mailhog-mamp.md
Install MailHog with MAMP Pro

Install MailHog with MAMP Pro, using HomeBrew.

MailHog

First let's make sure HB is updated. Open up terminal for the following steps.

$ brew update
@thefrosty
thefrosty / wp-rest-api-cache.php
Created February 1, 2018 21:47
WpRestApiCache Controller
<?php
/**
* WpRestApiCache Controller.
* This file extend the wp-rest-api-cache plugin that allows filtering of
* cache depending on conditions met.
*
* @package BeachbodyOnDemand\WpRestApiCache
*/
namespace BeachbodyOnDemand\WpRestApiCache;
@thefrosty
thefrosty / Add2faMetaBox.php
Created May 4, 2017 17:32
Dovedi and WP User Profiles support.
<?php
namespace Dwnload\Plugins\Dovedi;
/**
* Class Add2faMetaBox
*
* @package Dwnload\Plugins\Dovedi
*/
class Add2faMetaBox {