This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* Input: files matching src/pages/*.html | |
* Output: public/*.html | |
* | |
* Pages can extend a template by calling: | |
* | |
* extend(string $relativeTemplatePath, array $variables) | |
* | |
* at the start and: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Plugin Name: Spam Pixel | |
* Description: This simple plugin integrates Ross's spam pixel idea with WP Forms | |
* Author: Ross Wintle | |
* Author URI: https://rosswintle.uk | |
* Text Domain: spam-pixel | |
* Domain Path: /languages | |
* Version: 0.1.0 | |
* |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter('oembed_result', 'youtubeEmbedNocookieFilter', 10, 3); | |
function youtubeEmbedNocookieFilter(string $data, string $url, array $args) | |
{ | |
return str_replace('src="https://www.youtube.com/embed', 'src="https://www.youtube-nocookie.com/embed', $data); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Add these to your .bashrc file for some quick and clever recursive web-dev code searching | |
# from the command line/terminal. | |
# | |
# Should be easy enough to add your own too. | |
# | |
# Usage is just: | |
# | |
# phprgrep <regular expression> | |
# | |
# Regular expresssions need to be escaped/quoted if you're being clever. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Plugin Name: Weird Wide Webring | |
* Plugin URI: https://weirdwidewebring.net | |
* Description: A widget for displaying the Weird Wide Webring links | |
* Author: Ross Wintle | |
* Author URI: https://rosswintle.uk/ | |
* Text Domain: weird-wide-webring | |
* Domain Path: /languages | |
* Version: 1.0.0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* Tag for my LaravelAssetCache package: https://github.com/rosswintle/laravel-asset-cache/ | |
* | |
* This grabs the asset file from the specified npm package from jsdelivr.net, and caches and serves it locally | |
* | |
* Before use you'll need to: | |
* composer require rosswintle/laravel-asset-cache | |
* php artisan storage:link (in all environments) | |
* |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Plugin Name: Wordpress Cleanup | |
*/ | |
namespace WordPress_Cleanup; | |
/** | |
* Change filters here to control what this does | |
*/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function make_valid_pairing( $people_to_pair, $people_yet_to_have_gifts ) { | |
// We made it! No more people left to pair! Return an empty array of pairings. | |
if (empty($people_to_pair)) { | |
return []; | |
} | |
// Get the first person | |
$person_to_pair = $people_to_pair[0]; | |
// Get all the other people |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// adding support for html emails | |
// this converts ALL wp_mail emails to HTML, which messes up the password reset email | |
add_filter( 'wp_mail_content_type','prefix_set_content_type' ); | |
function prefix_set_content_type() { | |
return "text/html"; | |
} | |
// add this filter too | |
// this will make the password reset email compatible with the HTML format |