Changeset 6439
- Timestamp:
- 05/27/2017 05:35:23 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/includes/users/engagements.php
r6438 r6439 209 209 * Add a topic to user's engagements 210 210 * 211 * Note that both the User and Topic should be verified to exist before using 212 * this function. Originally both were validated, but because this function is 213 * frequently used within a loop, those verifications were moved upstream to 214 * improve performance on topics with many engaged users. 215 * 211 216 * @since 2.6.0 bbPress (r6320) 212 217 * … … 221 226 // Bail if not enough info 222 227 if ( empty( $user_id ) || empty( $topic_id ) ) { 223 return false;224 }225 226 // Bail if no topic227 $topic = bbp_get_topic( $topic_id );228 if ( empty( $topic ) ) {229 228 return false; 230 229 } … … 407 406 * Add a topic to user's favorites 408 407 * 408 * Note that both the User and Topic should be verified to exist before using 409 * this function. Originally both were validated, but because this function is 410 * frequently used within a loop, those verifications were moved upstream to 411 * improve performance on topics with many engaged users. 412 * 409 413 * @since 2.0.0 bbPress (r2652) 410 414 * … … 419 423 // Bail if not enough info 420 424 if ( empty( $user_id ) || empty( $topic_id ) ) { 421 return false;422 }423 424 // Bail if no topic425 $topic = bbp_get_topic( $topic_id );426 if ( empty( $topic ) ) {427 425 return false; 428 426 } … … 1005 1003 * Add a topic to user's subscriptions 1006 1004 * 1005 * Note that both the User and Topic should be verified to exist before using 1006 * this function. Originally both were validated, but because this function is 1007 * frequently used within a loop, those verifications were moved upstream to 1008 * improve performance on topics with many engaged users. 1009 * 1007 1010 * @since 2.0.0 bbPress (r2668) 1008 1011 * 1009 1012 * @param int $user_id Optional. User id 1010 1013 * @param int $topic_id Optional. Topic id 1011 * @uses bbp_get_topic() To get the topic1012 1014 * @uses bbp_add_user_subscription() To add the subscription 1013 1015 * @uses do_action() Calls 'bbp_add_user_subscription' with the user & topic id … … 1018 1020 // Bail if not enough info 1019 1021 if ( empty( $user_id ) || empty( $topic_id ) ) { 1020 return false;1021 }1022 1023 // Bail if no topic1024 $topic = bbp_get_topic( $topic_id );1025 if ( empty( $topic ) ) {1026 1022 return false; 1027 1023 }
Note: See TracChangeset
for help on using the changeset viewer.