Skip to content

Instantly share code, notes, and snippets.

Avatar

Mark Praschan MarkPraschan

View GitHub Profile
@MarkPraschan
MarkPraschan / functions.php
Created Jul 9, 2019
Declare post types for Yoast's Orphaned Content filter (wpseo_orphaned_post_types)
View functions.php
add_filter( 'wpseo_orphaned_post_types', 'set_wpseo_orphaned_post_types');
function set_wpseo_orphaned_post_types( $post_types ) {
$post_types = array(''); // empty array disables the orhpaned content filter for all post types
return $post_types;
}
@MarkPraschan
MarkPraschan / functions.php
Created Jan 23, 2019
Strip all post content (like shortcodes) located within [brackets] - Algolia / WordPress / WooCommerce
View functions.php
// STRIP SHORTCODES FROM ALGOLIA SEARCH RESULTS
add_filter( 'algolia_strip_patterns', function( $patterns ) {
$patterns[] = '/\[\/?.*?\]/g';
return $patterns;
} );
@MarkPraschan
MarkPraschan / functions.php
Created Nov 17, 2017
Hybrid WooCommerce Product Category Widget (Dropdown PLUS Subcategory List)
View functions.php
<?php
/**
* Adds customized product categories widget with subcategories (when applicable).
*/
class subcat_widget extends WP_Widget {
/**
* Register widget with WordPress.
*/