Skip to content

Instantly share code, notes, and snippets.

@jeherve
Last active September 11, 2016 03:00
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jeherve/acbe8a6c087174ffe3d9 to your computer and use it in GitHub Desktop.
Save jeherve/acbe8a6c087174ffe3d9 to your computer and use it in GitHub Desktop.
[Jetpack] Remove the Youtube shortcode
<?php
/*
* Plugin Name: Remove Jetpack's Youtube shortcode
* Plugin URI: http://wordpress.org/extend/plugins/jetpack/
* Description: Removes Jetpack's Youtueb shortcode
* Author: Jeremy Herve
* Version: 1.0
* Author URI: http://jeremyherve.com
* License: GPL2+
*/
function jeherve_remove_jytshortcode( $shortcodes ) {
$jetpack_shortcodes_dir = WP_CONTENT_DIR . '/plugins/jetpack/modules/shortcodes/';
$shortcodes_to_unload = array( 'youtube.php' );
foreach ( $shortcodes_to_unload as $shortcode ) {
if ( $key = array_search( $jetpack_shortcodes_dir . $shortcode, $shortcodes ) ) {
unset( $shortcodes[$key] );
}
}
return $shortcodes;
}
add_filter( 'jetpack_shortcodes_to_include', 'jeherve_remove_jytshortcode' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment