Skip to content

Instantly share code, notes, and snippets.

View mcfarlan's full-sized avatar

Ian McFarlan mcfarlan

View GitHub Profile
@mcfarlan
mcfarlan / tf-seo-meta-and-titles.php
Created April 16, 2020 12:07
Add this to your functions.php file, at the bottom
function filter_document_title( $title ) {
if ( is_home() && ! is_archive() ) {
$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
$title = 'TorrentFreak News - Page ' . $paged;
}
return $title;
}
add_filter( 'pre_get_document_title', __NAMESPACE__ . '\\filter_document_title', 30 );
function tf_yoast_seo_robots_remove_archives( $robots ) {
if ( !$this->startsWithZeros( $value ) ) {
if ( is_numeric( $value ) && ( floor( $value ) == $value ) && $value >= 0 && $value <= 4294967295 ) {
return MySQL::C_DATATYPE_UINT32;
}
if ( is_numeric( $value ) ) {
return MySQL::C_DATATYPE_DOUBLE;
}
}
@mcfarlan
mcfarlan / look-up-woo-deprecation.sh
Last active September 28, 2017 17:13
Looks for deprecated WooCommerce filters (v3.x.x)
#!/bin/bash
FUNCTIONS="
woocommerce_email_order_schema_markup,
add_to_cart_fragments,
add_to_cart_redirect,
woocommerce_product_width,
woocommerce_product_height,
woocommerce_product_length,
woocommerce_product_weight,
@mcfarlan
mcfarlan / rcp-address-fields-filters.php
Last active July 25, 2017 00:24
Override filters in RCP Address Fields
<?php
/*
Plugin Name: RCP Address Fields Filters
Plugin URI: http://www.vanpattenmedia.com/
Description: Override filters in RCP Address Fields
Version: 0.0.1
Author: Van Patten Media Inc.
Author URI: https://www.vanpattenmedia.com/
Contributors: chrisvanpatten, mcfarlan
*/