Skip to content

Instantly share code, notes, and snippets.

View MarkPraschan's full-sized avatar

Mark Praschan MarkPraschan

View GitHub Profile
@MarkPraschan
MarkPraschan / functions.php
Created July 9, 2019 18:09
Declare post types for Yoast's Orphaned Content filter (wpseo_orphaned_post_types)
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 January 23, 2019 14:58
Strip all post content (like shortcodes) located within [brackets] - Algolia / WordPress / WooCommerce
// STRIP SHORTCODES FROM ALGOLIA SEARCH RESULTS
add_filter( 'algolia_strip_patterns', function( $patterns ) {
$patterns[] = '/\[\/?.*?\]/g';
return $patterns;
} );
@MarkPraschan
MarkPraschan / functions.php
Created November 17, 2017 17:25
Hybrid WooCommerce Product Category Widget (Dropdown PLUS Subcategory List)
<?php
/**
* Adds customized product categories widget with subcategories (when applicable).
*/
class subcat_widget extends WP_Widget {
/**
* Register widget with WordPress.
*/