bp_nouveau_wrapper( array $args = array() )
Output HTML content into a wrapper.
Description
Parameters
- $args
-
(Optional) Optional arguments
Default value: array()
Source
File: bp-templates/bp-nouveau/includes/functions.php
250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 | function bp_nouveau_wrapper( $args = array () ) { /** * Classes need to be determined & set by component to a certain degree * * Check the component to find a default container_class to add */ $current_component_class = bp_current_component() . '-meta' ; $generic_class = 'bp-generic-meta' ; $r = wp_parse_args( $args , array ( 'container' => 'div' , 'container_id' => '' , 'container_classes' => array ( $generic_class , $current_component_class ), 'output' => '' , ) ); $valid_containers = array ( 'div' => true, 'ul' => true, 'ol' => true, 'span' => true, 'p' => true, ); // Actually merge some classes defaults and $args // @todo This is temp, we need certain classes but maybe improve this approach. $default_classes = array ( 'action' ); $r [ 'container_classes' ] = array_merge ( $r [ 'container_classes' ], $default_classes ); if ( empty ( $r [ 'container' ] ) || ! isset( $valid_containers [ $r [ 'container' ] ] ) || empty ( $r [ 'output' ] ) ) { return ; } $container = $r [ 'container' ]; $container_id = '' ; $container_classes = '' ; $output = trim( $r [ 'output' ]); if ( ! empty ( $r [ 'container_id' ] ) ) { $container_id = ' id="' . esc_attr( $r [ 'container_id' ] ) . '"' ; } if ( ! empty ( $r [ 'container_classes' ] ) && is_array ( $r [ 'container_classes' ] ) ) { $container_classes = ' class="' . join( ' ' , array_map ( 'sanitize_html_class' , $r [ 'container_classes' ] ) ) . '"' ; } // Print the wrapper and its content. printf( '<%1$s%2$s%3$s>%4$s</%1$s>' , $container , $container_id , $container_classes , $output ); } |
Changelog
Version | Description |
---|---|
BuddyPress 3.0.0 | Introduced. |
Questions?
We're always happy to help with code or other questions you might have! Search our developer docs, contact support, or connect with our sales team.