Changeset 1351
- Timestamp:
- 04/19/2009 12:21:53 PM (17 years ago)
- Location:
- trunk
- Files:
-
- 11 edited
-
bp-activity/bp-activity-classes.php (modified) (2 diffs)
-
bp-blogs/bp-blogs-classes.php (modified) (6 diffs)
-
bp-core/bp-core-adminbar.php (modified) (1 diff)
-
bp-friends/bp-friends-classes.php (modified) (2 diffs)
-
bp-groups/bp-groups-classes.php (modified) (2 diffs)
-
bp-messages/bp-messages-classes.php (modified) (2 diffs)
-
bp-messages/bp-messages-filters.php (modified) (1 diff)
-
bp-wire/bp-wire-classes.php (modified) (2 diffs)
-
bp-wire/bp-wire-filters.php (modified) (1 diff)
-
bp-xprofile/bp-xprofile-classes.php (modified) (5 diffs)
-
bp-xprofile/bp-xprofile-filters.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-activity/bp-activity-classes.php
r1338 r1351 45 45 function save() { 46 46 global $wpdb, $bp, $current_user; 47 48 do_action( 'bp_activity_before_save', $this ); 47 49 48 50 if ( !$this->item_id || !$this->user_id || $this->is_private || !$this->component_name ) … … 70 72 $sitewide_cached = $wpdb->query( $wpdb->prepare( "INSERT INTO {$bp->activity->table_name_sitewide} ( user_id, item_id, secondary_item_id, content, primary_link, component_name, component_action, date_cached, date_recorded ) VALUES ( %d, %d, %d, %s, %s, %s, %s, FROM_UNIXTIME(%d), FROM_UNIXTIME(%d) )", $this->user_id, $this->item_id, $this->secondary_item_id, $activity_content['content'], $activity_content['primary_link'], $this->component_name, $this->component_action, time(), $this->date_recorded ) ); 71 73 72 if ( $activity && $activity_cached ) 74 if ( $activity && $activity_cached ) { 75 do_action( 'bp_activity_after_save', $this ); 73 76 return true; 77 } 74 78 75 79 return false; -
trunk/bp-blogs/bp-blogs-classes.php
r1250 r1351 29 29 function save() { 30 30 global $wpdb, $bp; 31 32 $this->user_id = apply_filters( 'bp_blogs_blog_user_id_before_save', $this->user_id, $this->id ); 33 $this->blog_ud = apply_filters( 'bp_blogs_blog_id_before_save', $this->blog_id, $this->id ); 34 35 do_action( 'bp_blogs_blog_before_save', $this ); 31 36 32 37 // Don't try and save if there is no user ID or blog ID set. … … 48 53 if ( !$wpdb->query($sql) ) 49 54 return false; 55 56 do_action( 'bp_blogs_blog_after_save', $this ); 50 57 51 58 if ( $this->id ) … … 301 308 global $wpdb, $bp; 302 309 310 $this->post_id = apply_filters( 'bp_blogs_post_id_before_save', $this->post_id, $this->id ); 311 $this->blog_id = apply_filters( 'bp_blogs_post_blog_id_before_save', $this->blog_id, $this->id ); 312 $this->user_id = apply_filters( 'bp_blogs_post_user_id_before_save', $this->user_id, $this->id ); 313 $this->date_created = apply_filters( 'bp_blogs_post_date_created_before_save', $this->date_created, $this->id ); 314 315 do_action( 'bp_blogs_post_before_save', $this ); 316 303 317 if ( $this->id ) { 304 318 // Update … … 311 325 if ( !$wpdb->query($sql) ) 312 326 return false; 327 328 do_action( 'bp_blogs_post_after_save', $this ); 313 329 314 330 if ( $this->id ) … … 496 512 function save() { 497 513 global $wpdb, $bp; 514 515 $this->comment_id = apply_filters( 'bp_blogs_comment_id_before_save', $this->comment_id, $this->id ); 516 $this->comment_post_id = apply_filters( 'bp_blogs_comment_post_id_before_save', $this->comment_post_id, $this->id ); 517 $this->blog_id = apply_filters( 'bp_blogs_comment_blog_id_before_save', $this->blog_id, $this->id ); 518 $this->user_id = apply_filters( 'bp_blogs_comment_user_id_before_save', $this->user_id, $this->id ); 519 $this->date_created = apply_filters( 'bp_blogs_comment_date_created_before_save', $this->date_created, $this->id ); 520 521 do_action( 'bp_blogs_comment_before_save', $this ); 498 522 499 523 if ( $this->id ) { … … 507 531 if ( !$wpdb->query($sql) ) 508 532 return false; 533 534 do_action( 'bp_blogs_comment_after_save', $this ); 509 535 510 536 if ( $this->id ) -
trunk/bp-core/bp-core-adminbar.php
r1318 r1351 35 35 36 36 if ( !is_user_logged_in() ) { 37 echo '<li class="bp-login no-arrow"><a href="' . get_bloginfo('siteurl'). '/wp-login.php?redirect_to=' . urlencode( $bp->root_domain ) . '">' . __( 'Log In', 'buddypress' ) . '</a></li>';37 echo '<li class="bp-login no-arrow"><a href="' . $bp->root_domain . '/wp-login.php?redirect_to=' . urlencode( $bp->root_domain ) . '">' . __( 'Log In', 'buddypress' ) . '</a></li>'; 38 38 39 39 // Show "Sign Up" link if registrations are allowed -
trunk/bp-friends/bp-friends-classes.php
r1052 r1351 50 50 function save() { 51 51 global $wpdb, $bp; 52 53 $this->initiator_user_id = apply_filters( 'friends_friendship_initiator_user_id_before_save', $this->initiator_user_id, $this->id ); 54 $this->friend_user_id = apply_filters( 'friends_friendship_friend_user_id_before_save', $this->friend_user_id, $this->id ); 55 $this->is_confirmed = apply_filters( 'friends_friendship_is_confirmed_before_save', $this->is_confirmed, $this->id ); 56 $this->is_limited = apply_filters( 'friends_friendship_is_limited_before_save', $this->is_limited, $this->id ); 57 $this->date_created = apply_filters( 'friends_friendship_date_created_before_save', $this->date_created, $this->id ); 58 59 do_action( 'friends_friendship_before_save', $this ); 52 60 53 61 if ( $this->id ) { … … 59 67 $this->id = $wpdb->insert_id; 60 68 } 69 70 do_action( 'friends_friendship_after_save', $this ); 61 71 62 72 return $result; -
trunk/bp-groups/bp-groups-classes.php
r1348 r1351 91 91 global $wpdb, $bp; 92 92 93 $this->creator_id = apply_filters( 'groups_ details_creator_id_pre_save', $this->creator_id, $this->id );94 $this->name = apply_filters( 'groups_ details_name_pre_save', $this->name, $this->id );95 $this->slug = apply_filters( 'groups_ details_slug_pre_save', $this->slug, $this->id );96 $this->description = apply_filters( 'groups_ details_description_pre_save', $this->description, $this->id );97 $this->news = apply_filters( 'groups_ details_news_pre_save', $this->news, $this->id );98 $this->status = apply_filters( 'groups_ details_status_pre_save', $this->status, $this->id );99 $this->is_invitation_only = apply_filters( 'groups_ details_is_invitation_only_pre_save', $this->is_invitation_only, $this->id );100 $this->enable_wire = apply_filters( 'groups_ details_enable_wire_pre_save', $this->enable_wire, $this->id );101 $this->enable_forum = apply_filters( 'groups_ details_enable_forum_pre_save', $this->enable_forum, $this->id );102 $this->enable_photos = apply_filters( 'groups_ details_enable_photos_pre_save', $this->enable_photos, $this->id );103 $this->photos_admin_only = apply_filters( 'groups_ details_photos_admin_only_pre_save', $this->photos_admin_only, $this->id );104 $this->date_created = apply_filters( 'groups_ details_date_created_pre_save', $this->date_created, $this->id );105 $this->avatar_thumb = apply_filters( 'groups_ details_avatar_thumb_pre_save', $this->avatar_thumb, $this->id );106 $this->avatar_full = apply_filters( 'groups_ details_avatar_full_pre_save', $this->avatar_full, $this->id );107 108 do_action( 'groups_group_ pre_save', $this );93 $this->creator_id = apply_filters( 'groups_group_creator_id_before_save', $this->creator_id, $this->id ); 94 $this->name = apply_filters( 'groups_group_name_before_save', $this->name, $this->id ); 95 $this->slug = apply_filters( 'groups_group_slug_before_save', $this->slug, $this->id ); 96 $this->description = apply_filters( 'groups_group_description_before_save', $this->description, $this->id ); 97 $this->news = apply_filters( 'groups_group_news_before_save', $this->news, $this->id ); 98 $this->status = apply_filters( 'groups_group_status_before_save', $this->status, $this->id ); 99 $this->is_invitation_only = apply_filters( 'groups_group_is_invitation_only_before_save', $this->is_invitation_only, $this->id ); 100 $this->enable_wire = apply_filters( 'groups_group_enable_wire_before_save', $this->enable_wire, $this->id ); 101 $this->enable_forum = apply_filters( 'groups_group_enable_forum_before_save', $this->enable_forum, $this->id ); 102 $this->enable_photos = apply_filters( 'groups_group_enable_photos_before_save', $this->enable_photos, $this->id ); 103 $this->photos_admin_only = apply_filters( 'groups_group_photos_admin_only_before_save', $this->photos_admin_only, $this->id ); 104 $this->date_created = apply_filters( 'groups_group_date_created_before_save', $this->date_created, $this->id ); 105 $this->avatar_thumb = apply_filters( 'groups_group_avatar_thumb_before_save', $this->avatar_thumb, $this->id ); 106 $this->avatar_full = apply_filters( 'groups_group_avatar_full_before_save', $this->avatar_full, $this->id ); 107 108 do_action( 'groups_group_before_save', $this ); 109 109 110 110 if ( $this->id ) { … … 188 188 } 189 189 190 do_action( 'groups_group_ post_save', $this );190 do_action( 'groups_group_after_save', $this ); 191 191 192 192 return true; -
trunk/bp-messages/bp-messages-classes.php
r1280 r1351 334 334 function send() { 335 335 global $wpdb, $bp; 336 337 $this->subject = wp_filter_kses( $this->subject ); 338 $this->message = wp_filter_kses( $this->message ); 339 336 337 $this->sender_id = apply_filters( 'messages_message_sender_id_before_save', $this->sender_id, $this->id ); 338 $this->subject = apply_filters( 'messages_message_subject_before_save', $this->subject, $this->id ); 339 $this->message = apply_filters( 'messages_message_content_before_save', $this->message, $this->id ); 340 $this->date_sent = apply_filters( 'messages_message_date_sent_before_save', $this->date_sent, $this->id ); 341 $this->message_order = apply_filters( 'messages_message_order_before_save', $this->message_order, $this->id ); 342 $this->sender_is_group = apply_filters( 'messages_message_sender_is_group_before_save', $this->sender_is_group, $this->id ); 343 344 do_action( 'messages_message_before_save', $this ); 345 340 346 // First insert the message into the messages table 341 347 if ( !$wpdb->query( $wpdb->prepare( "INSERT INTO {$bp->messages->table_name_messages} ( sender_id, subject, message, date_sent, message_order, sender_is_group ) VALUES ( %d, %s, %s, FROM_UNIXTIME(%d), %d, %d )", $this->sender_id, $this->subject, $this->message, $this->date_sent, $this->message_order, $this->sender_is_group ) ) ) … … 399 405 $this->id = $message_id; 400 406 messages_remove_callback_values(); 407 408 do_action( 'messages_message_after_save', $this ); 401 409 402 410 return true; -
trunk/bp-messages/bp-messages-filters.php
r1154 r1351 41 41 add_filter( 'bp_messages_content_value', 'wp_filter_kses', 1 ); 42 42 add_filter( 'bp_message_content', 'wp_filter_kses', 1 ); 43 add_filter( 'messages_message_content_before_save', 'wp_filter_kses', 1 ); 44 add_filter( 'messages_message_subject_before_save', 'wp_filter_kses', 1 ); 43 45 44 46 ?> -
trunk/bp-wire/bp-wire-classes.php
r1280 r1351 39 39 global $wpdb, $bp; 40 40 41 $this->content = wp_filter_kses( $this->content ); 41 $this->item_id = apply_filters( 'bp_wire_post_item_id_before_save', $this->item_id, $this->id ); 42 $this->user_id = apply_filters( 'bp_wire_post_user_id_before_save', $this->user_id, $this->id ); 43 $this->content = apply_filters( 'bp_wire_post_content_before_save', $this->content, $this->id ); 44 $this->date_posted = apply_filters( 'bp_wire_post_date_posted_before_save', $this->date_posted, $this->id ); 45 46 do_action( 'bp_wire_post_before_save', $this ); 42 47 43 48 if ( $this->id ) { … … 79 84 if ( !$this->id ) 80 85 $this->id = $wpdb->insert_id; 86 87 do_action( 'bp_wire_post_after_save', $this ); 81 88 82 89 return $result; -
trunk/bp-wire/bp-wire-filters.php
r1154 r1351 15 15 16 16 add_filter( 'bp_wire_post_content', 'wp_filter_kses', 1 ); 17 add_filter( 'bp_wire_post_content_before_save', 'wp_filter_kses', 1 ); 17 18 18 19 ?> -
trunk/bp-xprofile/bp-xprofile-classes.php
r1311 r1351 46 46 global $wpdb, $bp; 47 47 48 $this->name = wp_filter_kses( $this->name ); 49 $this->description = wp_filter_kses( $this->description ); 50 51 if ( $this->id != null ) { 52 $sql = $wpdb->prepare("UPDATE {$bp->profile->table_name_groups} SET name = %s, description = %s WHERE id = %d", $this->name, $this->description, $this->id); 53 } else { 54 $sql = $wpdb->prepare("INSERT INTO {$bp->profile->table_name_groups} (name, description, can_delete) VALUES (%s, %s, 1)", $this->name, $this->description); 48 $this->name = apply_filters( 'xprofile_group_name_before_save', $this->name, $this->id ); 49 $this->description = apply_filters( 'xprofile_group_description_before_save', $this->description, $this->id ); 50 51 do_action( 'xprofile_group_before_save', $this ); 52 53 if ( $this->id ) { 54 $sql = $wpdb->prepare( "UPDATE {$bp->profile->table_name_groups} SET name = %s, description = %s WHERE id = %d", $this->name, $this->description, $this->id ); 55 } else { 56 $sql = $wpdb->prepare( "INSERT INTO {$bp->profile->table_name_groups} (name, description, can_delete) VALUES (%s, %s, 1)", $this->name, $this->description ); 55 57 } 56 58 57 59 if ( !$wpdb->query($sql) ) 58 60 return false; 61 62 do_action( 'xprofile_group_after_save', $this ); 59 63 60 64 return true; … … 246 250 global $wpdb, $bp; 247 251 248 $this->name = wp_filter_kses( $this->name ); 249 $this->desc = wp_filter_kses( $this->desc ); 252 $error = false; 253 254 $this->group_id = apply_filters( 'xprofile_field_group_id_before_save', $this->group_id, $this->id ); 255 $this->parent_id = apply_filters( 'xprofile_field_parent_id_before_save', $this->parent_id, $this->id ); 256 $this->type = apply_filters( 'xprofile_field_type_before_save', $this->type, $this->id ); 257 $this->name = apply_filters( 'xprofile_field_name_before_save', $this->name, $this->id ); 258 $this->desc = apply_filters( 'xprofile_field_description_before_save', $this->desc, $this->id ); 259 $this->is_required = apply_filters( 'xprofile_field_is_required_before_save', $this->is_required, $this->id ); 260 $this->is_public = apply_filters( 'xprofile_field_is_public_before_save', $this->is_public, $this->id ); 261 $this->order_by = apply_filters( 'xprofile_field_order_by_before_save', $this->order_by, $this->id ); 262 263 do_action( 'xprofile_field_before_save', $this ); 250 264 251 265 if ( $this->id != null ) { … … 354 368 } 355 369 } 356 357 return true;358 359 } else {360 return true;361 370 } 362 } 363 else 364 { 371 } else { 372 $error = true; 373 } 374 375 if ( !$error ) { 376 do_action( 'xprofile_field_after_save', $this ); 377 return true; 378 } else { 365 379 return false; 366 380 } … … 1039 1053 function save() { 1040 1054 global $wpdb, $bp; 1041 1042 $this->last_updated = date( 'Y-m-d H:i:s' ); 1043 $this->value = wp_filter_kses( $this->value ); 1044 1055 1056 $this->user_id = apply_filters( 'xprofile_data_user_id_before_save', $this->user_id, $this->id ); 1057 $this->field_id = apply_filters( 'xprofile_data_field_id_before_save', $this->field_id, $this->id ); 1058 $this->value = apply_filters( 'xprofile_data_value_before_save', $this->value, $this->id ); 1059 $this->last_updated = apply_filters( 'xprofile_data_last_updated_before_save', date( 'Y-m-d H:i:s' ), $this->id ); 1060 1061 do_action( 'xprofile_data_before_save', $this ); 1062 1045 1063 if ( $this->is_valid_field() ) { 1046 1064 if ( $this->exists() && $this->value != '' ) { … … 1056 1074 return false; 1057 1075 1076 do_action( 'xprofile_data_after_save', $this ); 1077 1058 1078 return true; 1059 1079 } -
trunk/bp-xprofile/bp-xprofile-filters.php
r1273 r1351 4 4 add_filter( 'bp_the_profile_field_value', 'wp_filter_kses', 1 ); 5 5 add_filter( 'xprofile_get_field_data', 'wp_filter_kses', 1 ); 6 add_filter( 'xprofile_field_name_before_save', 'wp_filter_kses', 1 ); 7 add_filter( 'xprofile_field_description_before_save', 'wp_filter_kses', 1 ); 6 8 7 9 add_filter( 'bp_the_profile_field_value', 'wptexturize' ); … … 16 18 add_filter( 'bp_the_profile_field_type', 'convert_smilies' ); 17 19 add_filter( 'bp_the_profile_field_type', 'convert_chars' ); 18 19 20 20 21 /* Custom BuddyPress filters */
Note: See TracChangeset
for help on using the changeset viewer.