Created
July 20, 2020 04:22
-
-
Save codeHusky/b3864ec14485e237b50b6dc799411827 to your computer and use it in GitHub Desktop.
WP Plugin that removes useless author info from WordPress Page embed data.
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
<?php | |
/** | |
* Plugin Name: oEmbed Patcher | |
* Description: Removes useless metadata from WordPress oEmbeds | |
* Version: 1.0.0 | |
* Author: Loki Rautio AKA codeHusky | |
*/ | |
// Be sure to enclose this in a folder of the same name as the file (minus .php). | |
// e.g. /wp-content/plugins/oembed-patcher/oembed-patcher.php | |
function oep_oembed_response_data( $data, $post, $width, $height){ | |
if ( $post->post_type == "page" ){ | |
unset($data['author_name']); | |
unset($data['author_url']); | |
} | |
return $data; | |
} | |
add_filter('oembed_response_data', 'oep_oembed_response_data', 10, 4); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment