Skip to:
Content

BuddyPress.org

Ticket #3399: 3399.02.patch

File 3399.02.patch, 12.5 KB (added by r-a-y, 13 years ago)
  • bp-activity/bp-activity-actions.php

    add_action( 'bp_actions', 'bp_activity_action_remove_favorite' ); 
    241241function bp_activity_action_sitewide_feed() {
    242242        global $bp, $wp_query;
    243243
    244         if ( !bp_is_current_component( 'activity' ) || !bp_is_current_action( 'feed' ) || bp_is_user() || !empty( $bp->groups->current_group ) )
     244        if ( !bp_is_activity_component() || !bp_is_current_action( 'feed' ) || bp_is_user() || !empty( $bp->groups->current_group ) )
    245245                return false;
    246246
    247247        $wp_query->is_404 = false;
    add_action( 'bp_actions', 'bp_activity_action_sitewide_feed' ); 
    255255function bp_activity_action_personal_feed() {
    256256        global $bp, $wp_query;
    257257
    258         if ( !bp_is_current_component( 'activity' ) || !bp_is_user() || !bp_is_current_action( 'feed' ) )
     258        if ( !bp_is_user_activity() || !bp_is_current_action( 'feed' ) )
    259259                return false;
    260260
    261261        $wp_query->is_404 = false;
    add_action( 'bp_actions', 'bp_activity_action_personal_feed' ); 
    269269function bp_activity_action_friends_feed() {
    270270        global $bp, $wp_query;
    271271
    272         if ( !bp_is_active( 'friends' ) || !bp_is_current_component( 'activity' ) || !bp_is_user() || !bp_is_current_action( bp_get_friends_slug() ) || !bp_is_action_variable( 'feed', 0 ) )
     272        if ( !bp_is_active( 'friends' ) || !bp_is_user_activity() || !bp_is_current_action( bp_get_friends_slug() ) || !bp_is_action_variable( 'feed', 0 ) )
    273273                return false;
    274274
    275275        $wp_query->is_404 = false;
    add_action( 'bp_actions', 'bp_activity_action_friends_feed' ); 
    283283function bp_activity_action_my_groups_feed() {
    284284        global $bp, $wp_query;
    285285
    286         if ( !bp_is_active( 'groups' ) || !bp_is_current_component( 'activity' ) || !bp_is_user() || !bp_is_current_action( bp_get_groups_slug() ) || !bp_is_action_variable( 'feed', 0 ) )
     286        if ( !bp_is_active( 'groups' ) || !bp_is_user_activity() || !bp_is_current_action( bp_get_groups_slug() ) || !bp_is_action_variable( 'feed', 0 ) )
    287287                return false;
    288288
    289289        $wp_query->is_404 = false;
    add_action( 'bp_actions', 'bp_activity_action_my_groups_feed' ); 
    297297function bp_activity_action_mentions_feed() {
    298298        global $bp, $wp_query;
    299299
    300         if ( !bp_is_current_component( 'activity' ) || !bp_is_user() || !bp_is_current_action( 'mentions' ) || !bp_is_action_variable( 'feed', 0 ) )
     300        if ( !bp_is_user_activity() || !bp_is_current_action( 'mentions' ) || !bp_is_action_variable( 'feed', 0 ) )
    301301                return false;
    302302
    303303        $wp_query->is_404 = false;
    add_action( 'bp_actions', 'bp_activity_action_mentions_feed' ); 
    311311function bp_activity_action_favorites_feed() {
    312312        global $bp, $wp_query;
    313313
    314         if ( !bp_is_current_component( 'activity' ) || !bp_is_user() || !bp_is_current_action( 'favorites' ) || !bp_is_action_variable( 'feed', 0 ) )
     314        if ( !bp_is_user_activity() || !bp_is_current_action( 'favorites' ) || !bp_is_action_variable( 'feed', 0 ) )
    315315                return false;
    316316
    317317        $wp_query->is_404 = false;
  • bp-core/bp-core-template.php

    function bp_is_settings_component() { 
    10641064function bp_is_single_activity() {
    10651065        global $bp;
    10661066
    1067         if ( bp_is_current_component( 'activity' ) && is_numeric( $bp->current_action ) )
     1067        if ( bp_is_activity_component() && is_numeric( $bp->current_action ) )
    10681068                return true;
    10691069
    10701070        return false;
    function bp_is_user() { 
    10951095function bp_is_user_activity() {
    10961096        global $bp;
    10971097
    1098         if ( bp_is_current_component( 'activity' ) )
     1098        if ( bp_is_activity_component() && bp_is_user() )
    10991099                return true;
    11001100
    11011101        return false;
    function bp_is_user_activity() { 
    11041104function bp_is_user_friends_activity() {
    11051105        global $bp;
    11061106
    1107         if ( bp_is_current_component( 'activity' ) && bp_is_current_action( 'my-friends' ) )
     1107        if ( bp_is_activity_component() && bp_is_current_action( 'my-friends' ) )
    11081108                return true;
    11091109
    11101110        return false;
    function bp_is_user_friends_activity() { 
    11131113function bp_is_user_profile() {
    11141114        global $bp;
    11151115
    1116         if ( bp_is_current_component( 'xprofile' ) || bp_is_current_component( 'profile' ) )
     1116        if ( bp_is_profile_component() || bp_is_current_component( 'profile' ) )
    11171117                return true;
    11181118
    11191119        return false;
    function bp_is_user_profile() { 
    11221122function bp_is_user_profile_edit() {
    11231123        global $bp;
    11241124
    1125         if ( bp_is_current_component( 'xprofile' ) && bp_is_current_action( 'edit' ) )
     1125        if ( bp_is_profile_component() && bp_is_current_action( 'edit' ) )
    11261126                return true;
    11271127
    11281128        return false;
    function bp_is_user_profile_edit() { 
    11311131function bp_is_user_change_avatar() {
    11321132        global $bp;
    11331133
    1134         if ( bp_is_current_component( 'xprofile' ) && bp_is_current_action( 'change-avatar' ) )
     1134        if ( bp_is_profile_component() && bp_is_current_action( 'change-avatar' ) )
    11351135                return true;
    11361136
    11371137        return false;
    function bp_is_user_change_avatar() { 
    11451145 * @return bool
    11461146 */
    11471147function bp_is_user_forums() {
    1148         if ( bp_is_current_component( 'forums' ) )
     1148        if ( bp_is_forums_component() && bp_is_user() )
    11491149                return true;
    11501150
    11511151        return false;
    function bp_is_user_forums() { 
    11601160 * @return bool
    11611161 */
    11621162function bp_is_user_forums_started() {
    1163         if ( bp_is_current_component( 'forums' ) && bp_is_current_action( 'topics' ) )
     1163        if ( bp_is_forums_component() && bp_is_current_action( 'topics' ) )
    11641164                return true;
    11651165
    11661166        return false;
    function bp_is_user_forums_started() { 
    11751175 * @return bool
    11761176 */
    11771177function bp_is_user_forums_replied_to() {
    1178         if ( bp_is_current_component( 'forums' ) && bp_is_current_action( 'replies' ) )
     1178        if ( bp_is_forums_component() && bp_is_current_action( 'replies' ) )
    11791179                return true;
    11801180
    11811181        return false;
    function bp_is_user_forums_replied_to() { 
    11841184function bp_is_user_groups() {
    11851185        global $bp;
    11861186
    1187         if ( bp_is_current_component( 'groups' ) )
     1187        if ( bp_is_groups_component() && bp_is_user() )
    11881188                return true;
    11891189
    11901190        return false;
    function bp_is_user_groups() { 
    11931193function bp_is_user_blogs() {
    11941194        global $bp;
    11951195
    1196         if ( is_multisite() && bp_is_current_component( 'blogs' ) )
     1196        if ( bp_is_blogs_component() && bp_is_user() )
    11971197                return true;
    11981198
    11991199        return false;
    function bp_is_user_blogs() { 
    12021202function bp_is_user_recent_posts() {
    12031203        global $bp;
    12041204
    1205         if ( is_multisite() && bp_is_current_component( 'blogs' ) && bp_is_current_action( 'recent-posts' ) )
     1205        if ( bp_is_blogs_component() && bp_is_current_action( 'recent-posts' ) )
    12061206                return true;
    12071207
    12081208        return false;
    function bp_is_user_recent_posts() { 
    12111211function bp_is_user_recent_commments() {
    12121212        global $bp;
    12131213
    1214         if ( is_multisite() && bp_is_current_component( 'blogs' ) && bp_is_current_action( 'recent-comments' ) )
     1214        if ( bp_is_blogs_component() && bp_is_current_action( 'recent-comments' ) )
    12151215                return true;
    12161216
    12171217        return false;
    function bp_is_user_recent_commments() { 
    12191219
    12201220function bp_is_user_friends() {
    12211221
    1222         if ( bp_is_current_component( 'friends' ) )
     1222        if ( bp_is_friends_component() && bp_is_user() )
    12231223                return true;
    12241224
    12251225        return false;
    function bp_is_user_friends() { 
    12281228function bp_is_user_friend_requests() {
    12291229        global $bp;
    12301230
    1231         if ( bp_is_current_component( 'friends' ) && bp_is_current_action( 'requests' ) )
     1231        if ( bp_is_friends_component() && bp_is_current_action( 'requests' ) )
    12321232                return true;
    12331233
    12341234        return false;
    function bp_is_group_single() { 
    13541354function bp_is_create_blog() {
    13551355        global $bp;
    13561356
    1357         if ( is_multisite() && bp_is_current_component( 'blogs' ) && bp_is_current_action( 'create' ) )
     1357        if ( bp_is_blogs_component() && bp_is_current_action( 'create' ) )
    13581358                return true;
    13591359
    13601360        return false;
    function bp_is_create_blog() { 
    13641364
    13651365function bp_is_user_messages() {
    13661366
    1367         if ( bp_is_current_component( 'messages' ) )
     1367        if ( bp_is_messages_component() && bp_is_user() )
    13681368                return true;
    13691369
    13701370        return false;
    function bp_is_user_messages() { 
    13731373function bp_is_messages_inbox() {
    13741374        global $bp;
    13751375
    1376         if ( bp_is_current_component( 'messages' ) && ( !bp_current_action() || bp_is_current_action( 'inbox' ) ) )
     1376        if ( bp_is_messages_component() && ( !bp_current_action() || bp_is_current_action( 'inbox' ) ) )
    13771377                return true;
    13781378
    13791379        return false;
    function bp_is_messages_inbox() { 
    13821382function bp_is_messages_sentbox() {
    13831383        global $bp;
    13841384
    1385         if ( bp_is_current_component( 'messages' ) && bp_is_current_action( 'sentbox' ) )
     1385        if ( bp_is_messages_component() && bp_is_current_action( 'sentbox' ) )
    13861386                return true;
    13871387
    13881388        return false;
    function bp_is_messages_sentbox() { 
    13911391function bp_is_messages_compose_screen() {
    13921392        global $bp;
    13931393
    1394         if ( bp_is_current_component( 'messages' ) && bp_is_current_action( 'compose' ) )
     1394        if ( bp_is_messages_component() && bp_is_current_action( 'compose' ) )
    13951395                return true;
    13961396
    13971397        return false;
    function bp_is_messages_compose_screen() { 
    14001400function bp_is_notices() {
    14011401        global $bp;
    14021402
    1403         if ( bp_is_current_component( 'messages' ) && bp_is_current_action( 'notices' ) )
     1403        if ( bp_is_messages_component() && bp_is_current_action( 'notices' ) )
    14041404                return true;
    14051405
    14061406        return false;
  • bp-forums/bp-forums-template.php

    function bp_has_forum_topic_posts( $args = '' ) { 
    10561056        $r = wp_parse_args( $args, $defaults );
    10571057        extract( $r, EXTR_SKIP );
    10581058
    1059         if ( empty( $topic_id ) && bp_is_current_component( 'groups') && bp_is_current_action( 'forum' ) && bp_is_action_variable( 'topic', 0 ) && bp_action_variable( 1 ) )
     1059        if ( empty( $topic_id ) && bp_is_groups_component() && bp_is_current_action( 'forum' ) && bp_is_action_variable( 'topic', 0 ) && bp_action_variable( 1 ) )
    10601060                $topic_id = bp_forums_get_topic_id_from_slug( bp_action_variable( 1 ) );
    1061         elseif ( empty( $topic_id ) && bp_is_current_component( 'forums') && bp_is_current_action( 'topic' ) && bp_action_variable( 0 ) )
     1061        elseif ( empty( $topic_id ) && bp_is_forums_component() && bp_is_current_action( 'topic' ) && bp_action_variable( 0 ) )
    10621062                $topic_id = bp_forums_get_topic_id_from_slug( bp_action_variable( 0 ) );
    10631063
    10641064        if ( empty( $topic_id ) ) {
  • bp-members/bp-members-screens.php

    function bp_members_screen_display_profile() { 
    3434 * @uses apply_filters()
    3535 */
    3636function bp_members_screen_index() {
    37         if ( !bp_is_user() && bp_is_current_component( 'members' ) ) {
     37        if ( !bp_is_user() && bp_is_members_component() ) {
    3838                bp_update_is_directory( true, 'members' );
    3939
    4040                do_action( 'bp_members_screen_index' );
  • bp-messages/bp-messages-template.php

    function bp_thread_has_messages( $args = '' ) { 
    722722        $r = wp_parse_args( $args, $defaults );
    723723        extract( $r, EXTR_SKIP );
    724724
    725         if ( !$thread_id && bp_is_current_component( 'messages' ) && bp_is_current_action( 'view' ) )
     725        if ( !$thread_id && bp_is_messages_component() && bp_is_current_action( 'view' ) )
    726726                $thread_id = (int)bp_action_variable( 0 );
    727727
    728728        $thread_template = new BP_Messages_Thread_Template( $thread_id, $order );
  • bp-themes/bp-default/sidebar.php

     
    5959        <?php endif; ?>
    6060
    6161        <?php /* Show forum tags on the forums directory */
    62         if ( bp_is_active( 'forums' ) && bp_is_current_component( 'forums' ) && bp_is_directory() ) : ?>
     62        if ( bp_is_active( 'forums' ) && bp_is_forums_component() && bp_is_directory() ) : ?>
    6363                <div id="forum-directory-tags" class="widget tags">
    6464                        <h3 class="widgettitle"><?php _e( 'Forum Topic Tags', 'buddypress' ) ?></h3>
    6565                        <div id="tag-text"><?php bp_forums_tag_heat_map(); ?></div>
  • bp-xprofile/bp-xprofile-actions.php

    if ( !defined( 'ABSPATH' ) ) exit; 
    2323function xprofile_action_delete_avatar() {
    2424        global $bp;
    2525
    26         if ( !bp_is_current_component( 'profile' ) || !bp_is_current_action( 'change-avatar' ) || !bp_is_action_variable( 'delete-avatar', 0 ) )
     26        if ( !bp_is_user_change_avatar() || !bp_is_action_variable( 'delete-avatar', 0 ) )
    2727                return false;
    2828
    2929        // Check the nonce