bp_nouveau_get_container_classes ()
返回主BuddyPress容器类。
描述
返回
(字符串)CSS类
源
文件:bp-templates / bp-nouveau /包括/ template-tags.php
函数bp_nouveau_get_container_classes() {$classes = array('buddypress-wrap');$ = bp_current_component组件();$ bp_nouveau = bp_nouveau ();$ member_type_class =”;If (bp_is_user()) {$customizer_option = 'user_nav_display';组件美元=“成员”;$user_type = bp_get_member_type(bp_displayed_user_id());$member_type_class = ($user_type)?$ user_type:”;} elseif (bp_is_group()) {$customizer_option = 'group_nav_display'; } elseif ( bp_is_directory() ) { switch ( $component ) { case 'activity': $customizer_option = 'activity_dir_layout'; break; case 'members': $customizer_option = 'members_dir_layout'; break; case 'groups': $customizer_option = 'groups_dir_layout'; break; case 'blogs': $customizer_option = 'sites_dir_layout'; break; case 'media': $customizer_option = 'media_dir_layout'; break; default: $customizer_option = ''; break; } } else { /** * Filters the BuddyPress Nouveau single item setting ID. * * @since BuddyPress 3.0.0 * * @param string $value Setting ID. */ $customizer_option = apply_filters( 'bp_nouveau_single_item_display_settings_id', '' ); } if ( $member_type_class ) { $classes[] = $member_type_class; } // Provide a class token to acknowledge additional extended profile fields added to default account reg screen if ( 'register' === bp_current_component() && bp_is_active( 'xprofile' ) && bp_nouveau_base_account_has_xprofile()) { $classes[] = 'extended-default-reg'; } // Add classes according to site owners preferences. These are options set via Customizer. // Set via earlier switch for component check to provide correct option key. if ( $customizer_option ) { $layout_prefs = bp_nouveau_get_temporary_setting( $customizer_option, bp_nouveau_get_appearance_settings( $customizer_option ) ); if ( $layout_prefs && (int) $layout_prefs === 1 && ( bp_is_user() || bp_is_group() ) ) { $classes[] = 'bp-single-vert-nav'; $classes[] = 'bp-vertical-navs'; } if ( $layout_prefs && bp_is_directory() ) { $classes[] = 'bp-dir-vert-nav'; $classes[] = 'bp-vertical-navs'; $bp_nouveau->{$component}->directory_vertical_layout = $layout_prefs; } else { $classes[] = 'bp-dir-hori-nav'; } } $class = array_map( 'sanitize_html_class', $classes ); /** * Filters the final results for BuddyPress Nouveau container classes. * * This filter will return a single string of concatenated classes to be used. * * @since BuddyPress 3.0.0 * * @param string $value Concatenated classes. * @param array $classes Array of classes that were concatenated. */ return apply_filters( 'bp_nouveau_get_container_classes', join( ' ', $class ), $classes ); }
更新日志
版本 | 描述 |
---|---|
BuddyPress 3.0.0 | 介绍了。 |