Created
August 17, 2013 18:32
-
-
Save jeherve/6258163 to your computer and use it in GitHub Desktop.
[Jetpack] Shortcodes: how to remove specific shortcodes
This file contains hidden or 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 | |
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