mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-12-06 12:51:58 +00:00
Actions for postmeta updates. Props Demitrious Kelly. see #10750
git-svn-id: https://develop.svn.wordpress.org/trunk@11968 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -1163,7 +1163,10 @@ function do_enclose( $content, $post_ID ) {
|
||||
|
||||
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 . '%') );
|
||||
$mid = $wpdb->get_col( $wpdb->prepare("SELECT meta_id FROM $wpdb->postmeta WHERE post_id = %d AND meta_key = 'enclosure' AND meta_value LIKE (%s)", $post_ID, $link_test . '%') );
|
||||
do_action( 'delete_postmeta', $mid );
|
||||
$wpdb->query( $wpdb->prepare("DELETE FROM $wpdb->postmeta WHERE post_id IN(%s)", implode( ',', $mid ) ) );
|
||||
do_action( 'deleted_postmeta', $mid );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1186,6 +1189,7 @@ function do_enclose( $content, $post_ID ) {
|
||||
if ( in_array( substr( $type, 0, strpos( $type, "/" ) ), $allowed_types ) ) {
|
||||
$meta_value = "$url\n$len\n$type\n";
|
||||
$wpdb->insert($wpdb->postmeta, array('post_id' => $post_ID, 'meta_key' => 'enclosure', 'meta_value' => $meta_value) );
|
||||
do_action( 'added_postmeta', $wpdb->insert_id, $post_ID, 'enclosure', $meta_value );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3386,4 +3390,4 @@ function wp_scheduled_delete() {
|
||||
wp_delete_comment($comment['comment_id']);
|
||||
}
|
||||
}
|
||||
?>
|
||||
?>
|
||||
|
||||
Reference in New Issue
Block a user