Skip to:
Content

bbPress.org


Ignore:
Timestamp:
05/27/2017 05:35:23 PM (7 years ago)
Author:
johnjamesjacoby
Message:

Engagements: Remove bbp_get_topic() checks from engagements.

See #3083.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/includes/users/engagements.php

    r6438 r6439  
    209209 * Add a topic to user's engagements
    210210 *
     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 *
    211216 * @since 2.6.0 bbPress (r6320)
    212217 *
     
    221226    // Bail if not enough info
    222227    if ( empty( $user_id ) || empty( $topic_id ) ) {
    223         return false;
    224     }
    225 
    226     // Bail if no topic
    227     $topic = bbp_get_topic( $topic_id );
    228     if ( empty( $topic ) ) {
    229228        return false;
    230229    }
     
    407406 * Add a topic to user's favorites
    408407 *
     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 *
    409413 * @since 2.0.0 bbPress (r2652)
    410414 *
     
    419423    // Bail if not enough info
    420424    if ( empty( $user_id ) || empty( $topic_id ) ) {
    421         return false;
    422     }
    423 
    424     // Bail if no topic
    425     $topic = bbp_get_topic( $topic_id );
    426     if ( empty( $topic ) ) {
    427425        return false;
    428426    }
     
    10051003 * Add a topic to user's subscriptions
    10061004 *
     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 *
    10071010 * @since 2.0.0 bbPress (r2668)
    10081011 *
    10091012 * @param int $user_id Optional. User id
    10101013 * @param int $topic_id Optional. Topic id
    1011  * @uses bbp_get_topic() To get the topic
    10121014 * @uses bbp_add_user_subscription() To add the subscription
    10131015 * @uses do_action() Calls 'bbp_add_user_subscription' with the user & topic id
     
    10181020    // Bail if not enough info
    10191021    if ( empty( $user_id ) || empty( $topic_id ) ) {
    1020         return false;
    1021     }
    1022 
    1023     // Bail if no topic
    1024     $topic = bbp_get_topic( $topic_id );
    1025     if ( empty( $topic ) ) {
    10261022        return false;
    10271023    }
Note: See TracChangeset for help on using the changeset viewer.