This file contains 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 | |
/** | |
* WP CLI Command: commandname | |
* | |
* @package commandname | |
*/ | |
WP_CLI::add_command( 'commandname', 'Commandname_CLI_Command' ); | |
/** |
This file contains 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
Scott Nellé has been a web software developer for over 15 years. Prior to Alley Interactive, Scott built developer tools and WordPress web applications for Union Street Media. He developed Simple 301 Redirects, a popular WordPress plugin for SEO practitioners—currently active on over 300,000 sites. | |
He graduated from Champlain College with a B.S. in web site development and management. In his spare time he enjoys playing music, autumns in Vermont and spending time with his cats. |
This file contains 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 | |
/** | |
* Exclude specific categories from being considered when selecting related products | |
*/ | |
function my_exclude_related_terms( $terms ) { | |
$exclude = array( 'First Category', 'second-category' ); | |
foreach ( $terms as $i => $term ) { | |
if ( in_array( $term->name, $exclude ) || in_array( $term->slug, $exclude ) ) { | |
unset( $terms[ $i ] ); | |
} |
This file contains 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 | |
function redirect_legacy_urls() { | |
if ( ! is_404() ) { | |
return; | |
} | |
$url = trim( parse_url( $_SERVER['REQUEST_URI'], PHP_URL_PATH ), '/' ); | |
if ( empty( $url ) ) { | |
return false; | |
} |