Changeset 511 for trunk/bp-wire.php
- Timestamp:
- 11/07/2008 06:01:12 PM (18 years ago)
- File:
-
- 1 edited
-
trunk/bp-wire.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-wire.php
r476 r511 85 85 global $bp; 86 86 87 if ( $bp['current_ action'] != 'post' )87 if ( $bp['current_component'] != $bp['xprofile']['slug'] && $bp['current_action'] != 'post' ) 88 88 return false; 89 89 90 if ( $wire_post_id = bp_wire_new_post( $bp['current_userid'], $_POST['wire-post-textarea'], $bp['profile']['table_name_wire'] ) ) { 91 $bp['message'] = __('Wire message successfully posted.', 'buddypress'); 92 $bp['message_type'] = 'success'; 93 94 do_action( 'bp_xprofile_new_wire_post', array( 'item_id' => $wire_post_id, 'component_name' => 'profile', 'component_action' => 'new_wire_post', 'is_private' => 0 ) ); 95 add_action( 'template_notices', 'bp_core_render_notice' ); 90 if ( !$wire_post_id = bp_wire_new_post( $bp['current_userid'], $_POST['wire-post-textarea'], $bp['profile']['table_name_wire'] ) ) { 91 bp_core_add_message( __('Wire message could not be posted. Please try again.', 'buddypress'), 'error' ); 92 } else { 93 bp_core_add_message( __('Wire message successfully posted.', 'buddypress') ); 94 do_action( 'bp_xprofile_new_wire_post', array( 'item_id' => $wire_post_id, 'component_name' => 'profile', 'component_action' => 'new_wire_post', 'is_private' => 0 ) ); 96 95 } 97 96 98 97 if ( !strpos( $_SERVER['HTTP_REFERER'], $bp['wire']['slug'] ) ) { 99 $bp['current_component'] = $bp['profile']['slug']; 100 $bp['current_action'] = 'public'; 101 bp_catch_uri( 'profile/index' ); 98 wp_redirect( $bp['current_domain'] ); 102 99 } else { 103 bp_catch_uri( 'wire/latest');104 } 100 wp_redirect( $bp['current_domain']. $bp['wire']['slug'] ); 101 } 105 102 } 106 103 add_action( 'wp', 'bp_wire_action_post', 3 ); … … 109 106 global $bp; 110 107 111 if ( $bp['current_ action'] != 'delete' )108 if ( $bp['current_component'] != $bp['xprofile']['slug'] && $bp['current_action'] != 'delete' ) 112 109 return false; 113 110 114 111 if ( bp_wire_delete_post( $bp['action_variables'][0], $bp['profile']['table_name_wire'] ) ) { 115 $bp['message'] = __('Wire message successfully deleted.', 'buddypress'); 116 $bp['message_type'] = 'success'; 117 118 do_action( 'bp_xprofile_delete_wire_post' ); 119 add_action( 'template_notices', 'bp_core_render_notice' ); 112 bp_core_add_message( __('Wire message successfully deleted.', 'buddypress'), false, true ); 113 do_action( 'bp_xprofile_delete_wire_post' ); 120 114 } 121 115 122 116 if ( !strpos( $_SERVER['HTTP_REFERER'], $bp['wire']['slug'] ) ) { 123 $bp['current_component'] = $bp['profile']['slug']; 124 $bp['current_action'] = 'public'; 125 bp_catch_uri( 'profile/index' ); 117 wp_redirect( $bp['current_domain'] ); 126 118 } else { 127 bp_catch_uri( 'wire/latest');119 wp_redirect( $bp['current_domain']. $bp['wire']['slug'] ); 128 120 } 129 121 }
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)