Changeset 11909
- Timestamp:
- 09/10/2009 02:43:45 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/includes/plugin.php
r11856 r11909 315 315 $current[] = $plugin; 316 316 sort($current); 317 do_action( 'activate_plugin', trim( $plugin) ); 317 318 update_option('active_plugins', $current); 318 do_action('activate_' . $plugin); 319 do_action( 'activate_' . trim( $plugin ) ); 320 do_action( 'activated_plugin', trim( $plugin) ); 319 321 ob_end_clean(); 320 322 } … … 344 346 if( ! is_plugin_active($plugin) ) 345 347 continue; 348 if ( ! $silent ) 349 do_action( 'deactivate_plugin', trim( $plugin ) ); 346 350 array_splice($current, array_search( $plugin, $current), 1 ); // Fixed Array-fu! 347 if ( ! $silent ) //Used by Plugin updater to internally deactivate plugin, however, not to notify plugins of the fact to prevent plugin output. 348 do_action('deactivate_' . trim( $plugin )); 351 //Used by Plugin updater to internally deactivate plugin, however, not to notify plugins of the fact to prevent plugin output. 352 if ( ! $silent ) { 353 do_action( 'deactivate_' . trim( $plugin ) ); 354 do_action( 'deactivated_plugin', trim( $plugin ) ); 355 } 349 356 } 350 357 -
trunk/wp-includes/post.php
r11880 r11909 533 533 wp_cache_delete($post_id, 'post_meta'); 534 534 535 do_action( 'added_post_meta', $wpdb->insert_id, $post_id, $meta_key, $meta_value ); 536 535 537 return true; 536 538 } … … 574 576 return false; 575 577 578 do_action( 'delete_post_meta', $meta_id, $post_id, $meta_key, $meta_value ); 579 576 580 if ( empty( $meta_value ) ) 577 581 $wpdb->query( $wpdb->prepare( "DELETE FROM $wpdb->postmeta WHERE post_id = %d AND meta_key = %s", $post_id, $meta_key ) ); … … 580 584 581 585 wp_cache_delete($post_id, 'post_meta'); 586 587 do_action( 'deleted_post_meta', $meta_id, $post_id, $meta_key, $meta_value ); 582 588 583 589 return true; … … 652 658 return false; 653 659 654 if ( ! $wpdb->get_var( $wpdb->prepare( "SELECT meta_key FROM $wpdb->postmeta WHERE meta_key = %s AND post_id = %d", $meta_key, $post_id ) ) ) { 660 $meta_id = $wpdb->get_var( $wpdb->prepare( "SELECT meta_id FROM $wpdb->postmeta WHERE meta_key = %s AND post_id = %d", $meta_key, $post_id ) ); 661 if ( ! $meta_id ) 655 662 return add_post_meta($post_id, $meta_key, $meta_value); 656 }657 663 658 664 $meta_value = maybe_serialize( stripslashes_deep($meta_value) ); … … 666 672 } 667 673 674 do_action( 'update_post_meta', $meta_id, $post_id, $meta_key, $meta_value ); 675 668 676 $wpdb->update( $wpdb->postmeta, $data, $where ); 669 677 wp_cache_delete($post_id, 'post_meta'); 678 679 do_action( 'updated_post_meta', $meta_id, $post_id, $meta_key, $meta_value ); 680 670 681 return true; 671 682 } -
trunk/wp-includes/user.php
r11397 r11909 308 308 $meta_value = trim( $meta_value ); 309 309 310 $cur = $wpdb->get_row( $wpdb->prepare("SELECT * FROM $wpdb->usermeta WHERE user_id = %d AND meta_key = %s", $user_id, $meta_key) ); 311 312 if ( $cur && $cur->umeta_id ) 313 do_action( 'delete_usermeta', $cur->umeta_id, $user_id, $meta_key, $meta_value ); 314 310 315 if ( ! empty($meta_value) ) 311 316 $wpdb->query( $wpdb->prepare("DELETE FROM $wpdb->usermeta WHERE user_id = %d AND meta_key = %s AND meta_value = %s", $user_id, $meta_key, $meta_value) ); … … 314 319 315 320 wp_cache_delete($user_id, 'users'); 321 322 if ( $cur && $cur->umeta_id ) 323 do_action( 'deleted_usermeta', $cur->umeta_id, $user_id, $meta_key, $meta_value ); 316 324 317 325 return true; … … 400 408 401 409 $cur = $wpdb->get_row( $wpdb->prepare("SELECT * FROM $wpdb->usermeta WHERE user_id = %d AND meta_key = %s", $user_id, $meta_key) ); 410 411 if ( $cur ) 412 do_action( 'update_usermeta', $cur->umeta_id, $user_id, $meta_key, $meta_value ); 413 402 414 if ( !$cur ) 403 415 $wpdb->insert($wpdb->usermeta, compact('user_id', 'meta_key', 'meta_value') ); … … 408 420 409 421 wp_cache_delete($user_id, 'users'); 422 423 if ( !$cur ) 424 do_action( 'added_usermeta', $wpdb->insert_id, $user_id, $meta_key, $meta_value ); 425 else 426 do_action( 'updated_usermeta', $cur->umeta_id, $user_id, $meta_key, $meta_value ); 410 427 411 428 return true;
Note: See TracChangeset
for help on using the changeset viewer.