mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-11 12:20:22 +00:00
Eliminate , , and . see #5182
git-svn-id: https://develop.svn.wordpress.org/trunk@6229 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -348,6 +348,8 @@ function add_meta( $post_ID ) {
|
||||
if ( in_array($metakey, $protected) )
|
||||
return false;
|
||||
|
||||
wp_cache_delete($post_ID, 'post_meta');
|
||||
|
||||
$result = $wpdb->query( "
|
||||
INSERT INTO $wpdb->postmeta
|
||||
(post_id,meta_key,meta_value )
|
||||
@@ -362,6 +364,9 @@ function delete_meta( $mid ) {
|
||||
global $wpdb;
|
||||
$mid = (int) $mid;
|
||||
|
||||
$post_id = $wpdb->get_var("SELECT post_id FROM $wpdb->postmeta WHERE meta_id = '$mid'");
|
||||
wp_cache_delete($post_id, 'post_meta');
|
||||
|
||||
return $wpdb->query( "DELETE FROM $wpdb->postmeta WHERE meta_id = '$mid'" );
|
||||
}
|
||||
|
||||
@@ -408,6 +413,9 @@ function update_meta( $mid, $mkey, $mvalue ) {
|
||||
if ( in_array($mkey, $protected) )
|
||||
return false;
|
||||
|
||||
$post_id = $wpdb->get_var("SELECT post_id FROM $wpdb->postmeta WHERE meta_id = '$mid'");
|
||||
wp_cache_delete($post_id, 'post_meta');
|
||||
|
||||
$mvalue = maybe_serialize( stripslashes( $mvalue ));
|
||||
$mvalue = $wpdb->escape( $mvalue );
|
||||
$mid = (int) $mid;
|
||||
|
||||
Reference in New Issue
Block a user