Skip to content

Instantly share code, notes, and snippets.

Phil Wylie mustardBees

Block or report user

Report or block mustardBees

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@mustardBees
mustardBees / list-variable-products.php
Created Mar 24, 2020
Generate list of WooCommerce variable products.
View list-variable-products.php
<?php
/*
Plugin Name: List Variable Products
Plugin URI: https://www.philwylie.co.uk/
Description: Generate list of WooCommerce variable products.
Version: 1.0.0
Author: Phil Wylie
Author URI: https://www.philwylie.co.uk/
License: GPL2
*/
@mustardBees
mustardBees / functions.php
Last active Mar 2, 2020
Filter a few parameters into WordPress YouTube oEmbed requests. Enable modest branding which hides the YouTube logo. Remove the video title and uploader information. Prevent related videos from being shown once the video has played.
View functions.php
<?php
/**
* Filter a few parameters into YouTube oEmbed requests
*
* @link http://goo.gl/yl5D3
*/
function iweb_modest_youtube_player( $html, $url, $args ) {
return str_replace( '?feature=oembed', '?feature=oembed&modestbranding=1&showinfo=0&rel=0', $html );
}
add_filter( 'oembed_result', 'iweb_modest_youtube_player', 10, 3 );
@mustardBees
mustardBees / functions.php
Created Feb 26, 2020
Prevent LearnDash certificates from being edited.
View functions.php
<?php
/**
* Prevent LearnDash certificates from being edited.
*
* @param $pdf
*/
function iweb_learndash_certification_created( $pdf ) {
$pdf->SetProtection( array( 'modify' ), '', '#:EcjN7P(sGjF*6L', 0, null );
}
add_action( 'learndash_certification_created', 'iweb_learndash_certification_created' );
View .htaccess
# BEGIN Force HTTPS
RewriteCond %{HTTP:X-Forwarded-Proto} !=https
RewriteCond %{HTTPS} !=on
RewriteCond %{REQUEST_METHOD} !=POST
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
# END Force HTTPS
@mustardBees
mustardBees / time-smudge.php
Created Feb 20, 2020
Do you have a bunch of posts which share the same publish date & time? Do you find the order of your posts shifts around each time a query is run? This can happen after running a mass import of posts. Time Smudge spaces out the publish time randomly over the same/next day giving you a definite value for a buttery smooth, consistent sort order.
View time-smudge.php
<?php
/*
Plugin Name: Time Smudge
Plugin URI: https://www.philwylie.co.uk/
Description: Do you have a bunch of posts which share the same publish date &amp; time? Do you find the order of your posts shifts around each time a query is run? This can happen after running a mass import of posts. Time Smudge spaces out the publish time randomly over the same/next day giving you a definite value for a buttery smooth, consistent sort order.
Version: 1.0.0
Author: Phil Wylie
Author URI: https://www.philwylie.co.uk/
License: GPL2
*/
@mustardBees
mustardBees / pw_convert_pw_gallery_to_file_list.php
Last active Feb 18, 2020
Convert pw_gallery to file_list
View pw_convert_pw_gallery_to_file_list.php
View import-terms.php
<?php
/*
Plugin Name: Import terms
Plugin URI: https://www.philwylie.co.uk/
Description: Given an array of terms, import into a specified taxonomy. Tool to help format array - https://link.from.pw/2tM8iEs
Version: 1.0.0
Author: Phil Wylie
Author URI: https://www.philwylie.co.uk/
License: GPL2
*/
@mustardBees
mustardBees / functions.php
Created Jun 29, 2015
Formidable Pro form builder - function to block email from certain domains
View functions.php
<?php
/**
* Block persistent marketers
*
* @param $errors
* @param $posted_field
* @param $posted_value
*
* @return mixed
*/
View cron.sh
0 18 * * 1-5 wp algolia reindex --all --path=/home/user/public_html
0 18 * * 1-5 wp algolia reindex searchable_posts --path=/home/user/public_html
View functions.php
<?php
/*
Plugin Name: Convert SMURF to CMB2 repeatable field groups
Plugin URI: http://www.iweb.co.uk/
Description: Go through and zero index each SMURF array.
Version: 1.0.0
Author: iWeb
Author URI: http://www.iweb.co.uk/
*/
You can’t perform that action at this time.