Skip to content

Instantly share code, notes, and snippets.

@jeherve

jeherve/plugin.php

Last active Sep 11, 2016
Embed
What would you like to do?
[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
You can’t perform that action at this time.