Remove stale enclosures. Props mystyman. fixes #6840
git-svn-id: https://develop.svn.wordpress.org/trunk@11315 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
3dafb2c908
commit
7f57ebe750
@ -1060,7 +1060,8 @@ function debug_fclose( $fp ) {
|
|||||||
/**
|
/**
|
||||||
* Check content for video and audio links to add as enclosures.
|
* Check content for video and audio links to add as enclosures.
|
||||||
*
|
*
|
||||||
* Will not add enclosures that have already been added. This is called as
|
* Will not add enclosures that have already been added and will
|
||||||
|
* remove enclosures that are no longer in the post. This is called as
|
||||||
* pingbacks and trackbacks.
|
* pingbacks and trackbacks.
|
||||||
*
|
*
|
||||||
* @package WordPress
|
* @package WordPress
|
||||||
@ -1091,6 +1092,12 @@ function do_enclose( $content, $post_ID ) {
|
|||||||
debug_fwrite( $log, 'Post contents:' );
|
debug_fwrite( $log, 'Post contents:' );
|
||||||
debug_fwrite( $log, $content . "\n" );
|
debug_fwrite( $log, $content . "\n" );
|
||||||
|
|
||||||
|
foreach ( $pung as $link_test ) {
|
||||||
|
if ( !in_array( $link_test, $post_links_temp[0] ) ) { // link no longer in post
|
||||||
|
$wpdb->query( $wpdb->prepare("DELETE FROM $wpdb->postmeta WHERE post_id = %d AND meta_key = 'enclosure' AND meta_value LIKE (%s)", $post_ID, $link_test . '%') );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
foreach ( (array) $post_links_temp[0] as $link_test ) {
|
foreach ( (array) $post_links_temp[0] as $link_test ) {
|
||||||
if ( !in_array( $link_test, $pung ) ) { // If we haven't pung it already
|
if ( !in_array( $link_test, $pung ) ) { // If we haven't pung it already
|
||||||
$test = parse_url( $link_test );
|
$test = parse_url( $link_test );
|
||||||
|
Loading…
Reference in New Issue
Block a user