Skip to content

Instantly share code, notes, and snippets.

@jeherve
Created August 17, 2013 18:32
Show Gist options
  • Save jeherve/6258163 to your computer and use it in GitHub Desktop.
Save jeherve/6258163 to your computer and use it in GitHub Desktop.
[Jetpack] Shortcodes: how to remove specific shortcodes
<?php
add_filter( 'jetpack_shortcodes_to_include', 'my_remove_shortcode_function' );
function my_remove_shortcode_function( $shortcodes ) {
$jetpack_shortcodes_dir = WP_CONTENT_DIR . '/plugins/jetpack/modules/shortcodes/';
$shortcodes_to_unload = array( 'ted.php', 'soundcloud.php', );
foreach ( $shortcodes_to_unload as $shortcode ) {
if ( $key = array_search( $jetpack_shortcodes_dir . $shortcode, $shortcodes ) ) {
unset( $shortcodes[$key] );
}
}
return $shortcodes;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment