BP_Nouveau::enqueue_styles()
Enqueue the template pack css files
Description
Source
File: bp-templates/bp-nouveau/buddypress-functions.php
342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 | public function enqueue_styles() { $min = bp_core_get_minified_asset_suffix(); $rtl = '' ; if ( is_rtl() ) { $rtl = '-rtl' ; } /** * Filters the BuddyPress Nouveau CSS dependencies. * * @since BuddyPress 3.0.0 * * @param array $value Array of style dependencies. Default Dashicons. */ $css_dependencies = apply_filters( 'bp_nouveau_css_dependencies' , array ( 'dashicons' ) ); /** * Filters the styles to enqueue for BuddyPress Nouveau. * * This filter provides a multidimensional array that will map to arguments used for wp_enqueue_style(). * The primary index should have the stylesheet handle to use, and be assigned an array that has indexes for * file location, dependencies, and version. * * @since BuddyPress 3.0.0 * * @param array $value Array of styles to enqueue. */ $styles = apply_filters( 'bp_nouveau_enqueue_styles' , array ( 'bp-nouveau' => array ( 'file' => 'css/buddypress%1$s%2$s.css' , 'dependencies' => $css_dependencies , 'version' => $this ->version, ), ) ); if ( $styles ) { foreach ( $styles as $handle => $style ) { if ( ! isset( $style [ 'file' ] ) ) { continue ; } $file = sprintf( $style [ 'file' ], $rtl , $min ); // Locate the asset if needed. if ( false === strpos ( $style [ 'file' ], '://' ) ) { $asset = bp_locate_template_asset( $file ); if ( empty ( $asset [ 'uri' ] ) || false === strpos ( $asset [ 'uri' ], '://' ) ) { continue ; } $file = $asset [ 'uri' ]; } $data = wp_parse_args( $style , array ( 'dependencies' => array (), 'version' => $this ->version, 'type' => 'screen' , ) ); wp_enqueue_style( $handle , $file , $data [ 'dependencies' ], $data [ 'version' ], $data [ 'type' ] ); if ( $min ) { wp_style_add_data( $handle , 'suffix' , $min ); } } } } |
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.