Missing argument 2 for bp_get_the_body_class
-
Installed v1.1.1. I get this error message in all pages (related to body tag in header.php):
Missing argument 2 for bp_get_the_body_class() in /serverpath/wp-content/plugins/buddypress/bp-core/bp-core-templatetags.php on line 1593
function bp_get_the_body_class( $wp_classes, $custom_classes ) {
global $bp;
if ( bp_is_blog_page() && is_front_page() && $bp->current_component != BP_HOME_BLOG_SLUG )
$bp_classes[] = 'home-page';
if ( bp_is_blog_page() || bp_is_register_page() || bp_is_activation_page() )
$bp_classes[] = 'blog-page';
if ( !bp_is_blog_page() && !bp_is_register_page() && !bp_is_activation_page() )
$bp_classes[] = 'internal-page';
if ( bp_is_directory() )
$bp_classes[] = 'directory';
if ( bp_is_user_profile() && !bp_is_blog_page() )
$bp_classes[] = 'profile';
if ( bp_is_activity_component() && !bp_is_blog_page() )
$bp_classes[] = 'activity';
if ( bp_is_blogs_component() && !bp_is_blog_page() )
$bp_classes[] = 'blogs';
if ( bp_is_wire_component() && !bp_is_blog_page() )
$bp_classes[] = 'wire';
if ( bp_is_messages_component() && !bp_is_blog_page() )
$bp_classes[] = 'messages';
if ( bp_is_friends_component() && !bp_is_blog_page() )
$bp_classes[] = 'friends';
if ( bp_is_groups_component() && !bp_is_blog_page() )
$bp_classes[] = 'groups';
if ( bp_is_settings_component() && !bp_is_blog_page() )
$bp_classes[] = 'settings';
if ( bp_is_single_item() )
$bp_classes[] = 'single-item';
if ( bp_is_messages_inbox() )
$bp_classes[] = 'inbox';
if ( bp_is_messages_sentbox() )
$bp_classes[] = 'sentbox';
if ( bp_is_messages_compose_screen() )
$bp_classes[] = 'compose';
if ( bp_is_notices() )
$bp_classes[] = 'notices';
if ( bp_is_friend_requests() )
$bp_classes[] = 'friend-requests';
if ( bp_is_user_friends() )
$bp_classes[] = 'my-friends';
if ( bp_is_create_blog() )
$bp_classes[] = 'create-blog';
if ( bp_is_user_recent_commments() )
$bp_classes[] = 'recent-comments';
if ( bp_is_user_recent_posts() )
$bp_classes[] = 'recent-posts';
if ( bp_is_user_blogs() && !bp_is_directory() )
$bp_classes[] = 'my-blogs';
if ( bp_is_user_groups() && !bp_is_directory() )
$bp_classes[] = 'my-groups';
if ( bp_is_group_leave() )
$bp_classes[] = 'leave-group';
if ( bp_is_group_invites() )
$bp_classes[] = 'group-invites';
if ( bp_is_group_members() )
$bp_classes[] = 'group-members';
if ( bp_is_group_forum_topic() )
$bp_classes[] = 'group-forum-topic';
if ( bp_is_group_forum() )
$bp_classes[] = 'group-forum';
if ( bp_is_group_wire() )
$bp_classes[] = 'group-wire';
if ( bp_is_group_admin_page() )
$bp_classes[] = 'group-admin';
if ( bp_is_group_create() )
$bp_classes[] = 'group-create';
if ( bp_is_group_home() )
$bp_classes[] = 'group-home';
if ( bp_is_profile_wire() )
$bp_classes[] = 'profile-wire';
if ( bp_is_change_avatar() )
$bp_classes[] = 'change-avatar';
if ( bp_is_profile_edit() )
$bp_classes[] = 'profile-edit';
if ( bp_is_user_friends_activity() )
$bp_classes[] = 'friends-activity';
if ( bp_is_user_activity() )
$bp_classes[] = 'my-activity';
if ( bp_is_register_page() )
$bp_classes[] = 'registration';
if ( bp_is_activation_page() )
$bp_classes[] = 'activation';
if ( is_user_logged_in() )
$bp_classes[] = 'logged-in';
/* Add the current_component, current_action into the bp classes */
if ( !bp_is_blog_page() ) {
if ( !empty( $bp->current_component ) )
$bp_classes[] = $bp->current_component;
if ( !empty( $bp->current_action ) )
$bp_classes[] = $bp->current_action;
}
/* We don't want WordPress blog classes to appear on non-blog pages. */
if ( !bp_is_blog_page() || is_home() ) {
/* Preserve any custom classes already set */
if ( !empty( $custom_classes ) )
$wp_classes = (array) $custom_classes;
else
$wp_classes = array();
}
/* Merge WP classes with BP classes */
$classes = array_merge( (array) $bp_classes, (array) $wp_classes );
/* Remove any duplicates */
$classes = array_unique( $classes );
return apply_filters( 'bp_get_the_body_class', $classes, $bp_classes, $wp_classes, $custom_classes );
}
add_filter( 'body_class', 'bp_get_the_body_class', 10, 2 )
Viewing 6 replies - 1 through 6 (of 6 total)
Viewing 6 replies - 1 through 6 (of 6 total)
- The topic ‘Missing argument 2 for bp_get_the_body_class’ is closed to new replies.