Changeset 12281
- Timestamp:
- 11/07/2018 04:09:00 PM (6 years ago)
- Location:
- trunk/src
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-activity/bp-activity-filters.php
r12112 r12281 323 323 } 324 324 325 $bp = buddypress(); 326 325 327 // If our temporary variable doesn't exist, stop now. 326 if ( empty( buddypress()->activity->mentioned_users ) )328 if ( empty( $bp->activity->mentioned_users ) ) 327 329 return; 328 330 329 331 // Grab our temporary variable from bp_activity_at_name_filter_updates(). 330 $usernames = buddypress()->activity->mentioned_users;332 $usernames = $bp->activity->mentioned_users; 331 333 332 334 // Get rid of temporary variable. 333 unset( buddypress()->activity->mentioned_users );335 unset( $bp->activity->mentioned_users ); 334 336 335 337 // Send @mentions and setup BP notifications. -
trunk/src/bp-activity/bp-activity-functions.php
r12154 r12281 21 21 */ 22 22 function bp_activity_has_directory() { 23 return (bool) !empty( buddypress()->pages->activity->id );23 return isset( buddypress()->pages->activity->id ) && buddypress()->pages->activity->id; 24 24 } 25 25 -
trunk/src/bp-blogs/bp-blogs-activity.php
r12169 r12281 1159 1159 // Initialize a local object so we won't have to query this again in the 1160 1160 // comment loop. 1161 if ( empty( buddypress()->blogs->allow_comments ) ) {1161 if ( ! isset( buddypress()->blogs->allow_comments ) ) { 1162 1162 buddypress()->blogs->allow_comments = array(); 1163 1163 } 1164 if ( empty( buddypress()->blogs->thread_depth ) ) {1164 if ( ! isset( buddypress()->blogs->thread_depth ) ) { 1165 1165 buddypress()->blogs->thread_depth = array(); 1166 1166 } 1167 if ( empty( buddypress()->blogs->comment_moderation ) ) {1167 if ( ! isset( buddypress()->blogs->comment_moderation ) ) { 1168 1168 buddypress()->blogs->comment_moderation = array(); 1169 1169 } … … 1243 1243 // If comments are closed for the WP blog post, we should disable 1244 1244 // activity comments for this activity entry. 1245 if ( empty( buddypress()->blogs->allow_comments[ bp_get_activity_id() ] )) {1245 if ( ! isset( buddypress()->blogs->allow_comments[ bp_get_activity_id() ] ) || ! buddypress()->blogs->allow_comments[ bp_get_activity_id() ] ) { 1246 1246 $retval = false; 1247 1247 } 1248 1248 1249 1249 // If comments need moderation, disable activity commenting. 1250 if ( ! empty( buddypress()->blogs->comment_moderation[ bp_get_activity_id() ] )) {1250 if ( isset( buddypress()->blogs->comment_moderation[ bp_get_activity_id() ] ) && buddypress()->blogs->comment_moderation[ bp_get_activity_id() ] ) { 1251 1251 $retval = false; 1252 1252 } … … 1329 1329 // The blog post has closed off commenting, so we should disable all activity 1330 1330 // comments under the parent 'new_blog_post' activity entry. 1331 if ( empty( buddypress()->blogs->allow_comments[$comment->item_id] )) {1331 if ( ! buddypress()->blogs->allow_comments[ $comment->item_id ] ) { 1332 1332 $retval = false; 1333 1333 } … … 1335 1335 1336 1336 // If comments need moderation, disable activity commenting. 1337 if ( ! empty( buddypress()->blogs->comment_moderation[$comment->item_id] )) {1337 if ( isset( buddypress()->blogs->comment_moderation[ $comment->item_id ] ) && buddypress()->blogs->comment_moderation[ $comment->item_id ] ) { 1338 1338 $retval = false; 1339 1339 } -
trunk/src/bp-core/bp-core-functions.php
r12259 r12281 2549 2549 */ 2550 2550 function bp_nav_menu_get_loggedin_pages() { 2551 $bp = buddypress(); 2551 2552 2552 2553 // Try to catch the cached version first. 2553 if ( ! empty( buddypress()->wp_nav_menu_items->loggedin ) ) {2554 return buddypress()->wp_nav_menu_items->loggedin;2554 if ( ! empty( $bp->wp_nav_menu_items->loggedin ) ) { 2555 return $bp->wp_nav_menu_items->loggedin; 2555 2556 } 2556 2557 2557 2558 // Pull up a list of items registered in BP's primary nav for the member. 2558 $bp_menu_items = buddypress()->members->nav->get_primary();2559 $bp_menu_items = $bp->members->nav->get_primary(); 2559 2560 2560 2561 // Some BP nav menu items will not be represented in bp_nav, because … … 2591 2592 } 2592 2593 2593 if ( empty( buddypress()->wp_nav_menu_items ) ) {2594 if ( empty( $bp->wp_nav_menu_items ) ) { 2594 2595 buddypress()->wp_nav_menu_items = new stdClass; 2595 2596 } 2596 2597 2597 buddypress()->wp_nav_menu_items->loggedin = $page_args;2598 $bp->wp_nav_menu_items->loggedin = $page_args; 2598 2599 2599 2600 return $page_args; … … 2615 2616 */ 2616 2617 function bp_nav_menu_get_loggedout_pages() { 2618 $bp = buddypress(); 2617 2619 2618 2620 // Try to catch the cached version first. 2619 if ( ! empty( buddypress()->wp_nav_menu_items->loggedout ) ) {2620 return buddypress()->wp_nav_menu_items->loggedout;2621 if ( ! empty( $bp->wp_nav_menu_items->loggedout ) ) { 2622 return $bp->wp_nav_menu_items->loggedout; 2621 2623 } 2622 2624 … … 2665 2667 } 2666 2668 2667 if ( empty( buddypress()->wp_nav_menu_items ) ) {2668 buddypress()->wp_nav_menu_items = new stdClass;2669 } 2670 2671 buddypress()->wp_nav_menu_items->loggedout = $page_args;2669 if ( empty( $bp->wp_nav_menu_items ) ) { 2670 $bp->wp_nav_menu_items = new stdClass; 2671 } 2672 2673 $bp->wp_nav_menu_items->loggedout = $page_args; 2672 2674 2673 2675 return $page_args; -
trunk/src/bp-core/bp-core-template-loader.php
r11447 r12281 563 563 */ 564 564 function bp_is_template_included() { 565 return ! empty( buddypress()->theme_compat->found_template );565 return isset( buddypress()->theme_compat->found_template ) && buddypress()->theme_compat->found_template; 566 566 } 567 567 -
trunk/src/bp-core/bp-core-template.php
r12224 r12281 139 139 140 140 // Use the string provided by the component. 141 if ( ! empty( buddypress()->{$component}->directory_title )) {141 if ( isset( buddypress()->{$component}->directory_title ) && buddypress()->{$component}->directory_title ) { 142 142 $title = buddypress()->{$component}->directory_title; 143 143 … … 1150 1150 */ 1151 1151 function bp_account_was_activated() { 1152 $activation_complete = ! empty( buddypress()->activation_complete ) || ( bp_is_current_component( 'activate' ) && ! empty( $_GET['activated'] ) ); 1152 $bp = buddypress(); 1153 1154 $activation_complete = ! empty( $bp->activation_complete ) || ( bp_is_current_component( 'activate' ) && ! empty( $_GET['activated'] ) ); 1153 1155 1154 1156 return $activation_complete; … … 2082 2084 } 2083 2085 2084 if ( empty( buddypress()->$component->features ) || false === in_array( $feature, buddypress()->$component->features, true ) ) { 2086 $component_features = isset( buddypress()->{$component}->features ) ? buddypress()->{$component}->features : array(); 2087 2088 if ( empty( $component_features ) || false === in_array( $feature, $component_features, true ) ) { 2085 2089 $retval = false; 2086 2090 } -
trunk/src/bp-core/bp-core-theme-compatibility.php
r11987 r12281 687 687 688 688 // Bail if the template already matches a BuddyPress template. 689 if ( ! empty( buddypress()->theme_compat->found_template )) {689 if ( isset( buddypress()->theme_compat->found_template ) && buddypress()->theme_compat->found_template ) { 690 690 return $template; 691 691 } -
trunk/src/bp-core/classes/class-bp-core-oembed-extension.php
r11447 r12281 425 425 // Add markers to tell that we're embedding a single activity. 426 426 // This is needed for various oEmbed response data filtering. 427 if ( empty( buddypress()->{$this->slug_endpoint} )) {427 if ( ! isset( buddypress()->{$this->slug_endpoint} ) || ! buddypress()->{$this->slug_endpoint} ) { 428 428 buddypress()->{$this->slug_endpoint} = new stdClass; 429 429 } … … 534 534 535 535 // Add custom route args to iframe. 536 if ( ! empty( buddypress()->{$this->slug_endpoint}->embedargs_in_progress )) {536 if ( isset( buddypress()->{$this->slug_endpoint}->embedargs_in_progress ) && buddypress()->{$this->slug_endpoint}->embedargs_in_progress ) { 537 537 foreach( buddypress()->{$this->slug_endpoint}->embedargs_in_progress as $key => $value ) { 538 538 $url = add_query_arg( $key, $value, $url ); -
trunk/src/bp-groups/bp-groups-template.php
r11938 r12281 5615 5615 if ( groups_get_current_group() ) { 5616 5616 $r['group_id'] = bp_get_current_group_id(); 5617 } elseif ( ! empty( buddypress()->groups->new_group_id )) {5617 } elseif ( isset( buddypress()->groups->new_group_id ) && buddypress()->groups->new_group_id ) { 5618 5618 $r['group_id'] = buddypress()->groups->new_group_id; 5619 5619 }
Note: See TracChangeset
for help on using the changeset viewer.