Changeset 13503 for trunk/src/bp-messages/bp-messages-star.php
- Timestamp:
- 06/18/2023 04:11:04 AM (22 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-messages/bp-messages-star.php
r13442 r13503 114 114 ); 115 115 116 // Check user ID and determine base user slug. 117 $user_slug = bp_members_get_user_slug( $r['user_id'] ); 118 119 // Bail if no user domain was calculated. 120 if ( empty( $user_slug ) ) { 116 // Check user ID. 117 $user_id = (int) $r['user_id']; 118 if ( empty( $user_id ) ) { 121 119 return ''; 122 120 } 123 121 124 $message_slug = bp_get_messages_slug(); 125 $custom_message_slug = bp_rewrites_get_slug( 'members', 'member_' . $message_slug, $message_slug ); 126 $path_chunks = array( 127 'component_id' => 'members', 128 'single_item' => $user_slug, 129 'single_item_component' => $custom_message_slug, 130 ); 122 // Init path chunks. 123 $path_chunks = array( bp_get_messages_slug() ); 131 124 132 125 // Define local variables. … … 175 168 176 169 if ( true === $is_starred ) { 177 $action 178 $bulk_attr 179 $path_chunks[ 'single_item_action'] = bp_rewrites_get_slug( 'members', 'member_' . $message_slug . '_unstar', 'unstar' );180 $path_chunks[ 'single_item_action_variables'] = array( $message_id, $nonce, bp_rewrites_get_slug( 'members', 'member_' . $message_slug . '_all', 'all' ));170 $action = 'unstar'; 171 $bulk_attr = ' data-star-bulk="1"'; 172 $path_chunks[] = $action; 173 $path_chunks[] = array( $message_id, $nonce, 'all' ); 181 174 } else { 182 $action 183 $path_chunks[ 'single_item_action'] = bp_rewrites_get_slug( 'members', 'member_' . $message_slug . '_star', 'star' );184 $path_chunks[ 'single_item_action_variables'] = array( $message_id, $nonce );175 $action = 'star'; 176 $path_chunks[] = $action; 177 $path_chunks[] = array( $message_id, $nonce ); 185 178 } 186 179 … … 194 187 195 188 if ( true === $is_starred ) { 196 $action = 'unstar'; 197 $path_chunks['single_item_action'] = bp_rewrites_get_slug( 'members', 'member_' . $message_slug . '_unstar', 'unstar' ); 198 $path_chunks['single_item_action_variables'] = array( $message_id, $nonce ); 189 $action = 'unstar'; 199 190 } else { 200 $action 201 $path_chunks['single_item_action'] = bp_rewrites_get_slug( 'members', 'member_' . $message_slug . '_star', 'star' );202 $path_chunks['single_item_action_variables'] = array( $message_id, $nonce ); 203 }204 205 $title = $r["title_{$action}"];206 } 207 208 $url = bp_ rewrites_get_url( $path_chunks);191 $action = 'star'; 192 } 193 194 $path_chunks[] = $action; 195 $path_chunks[] = array( $message_id, $nonce ); 196 $title = $r["title_{$action}"]; 197 } 198 199 $url = bp_members_get_user_url( $user_id, bp_members_get_path_chunks( $path_chunks ) ); 209 200 210 201 /**
Note: See TracChangeset
for help on using the changeset viewer.