Created
January 23, 2019 14:58
-
-
Save MarkPraschan/9fd11ef3c831292596432ecc36aab02a to your computer and use it in GitHub Desktop.
Strip all post content (like shortcodes) located within [brackets] - Algolia / WordPress / WooCommerce
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
// STRIP SHORTCODES FROM ALGOLIA SEARCH RESULTS | |
add_filter( 'algolia_strip_patterns', function( $patterns ) { | |
$patterns[] = '/\[\/?.*?\]/g'; | |
return $patterns; | |
} ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
For use with Algolia for WordPress / WooCommerce. Global-scope on this regex means it will find all instances of post/page content between brackets.