Changeset 13145
- Timestamp:
- 11/13/2021 02:33:37 PM (3 years ago)
- Location:
- trunk/src
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-core/bp-core-template-loader.php
r13002 r13145 454 454 $templates = apply_filters( "bp_get_{$type}_template", $templates ); 455 455 456 // Filter possible templates, try to match one, and set any BuddyPress theme 457 // compat properties so they can be cross-checked later. 456 /* 457 * Filter possible templates, try to match one, and set any BuddyPress theme 458 * compat properties so they can be cross-checked later. 459 */ 458 460 $templates = bp_set_theme_compat_templates( $templates ); 459 461 $template = bp_locate_template( $templates ); 460 $template = bp_set_theme_compat_template( $template ); 462 463 /* 464 * The current theme is using the WordPress Full Site Editing feature. 465 * BuddyPress then needs to use the WordPress template canvas to retrieve the community content. 466 */ 467 if ( current_theme_supports( 'block-templates' ) && $template === get_theme_file_path( 'index.php' ) ) { 468 $template = ABSPATH . WPINC . '/template-canvas.php'; 469 } 470 471 $template = bp_set_theme_compat_template( $template ); 461 472 462 473 /** -
trunk/src/bp-templates/bp-nouveau/buddypress-functions.php
r13089 r13145 177 177 add_action( 'bp_actions', array( $this, 'neutralize_core_template_notices' ), 6 ); 178 178 179 // Scripts. 180 add_action( 'bp_enqueue_scripts', array( $this, 'register_scripts' ), 2 ); // Register theme JS. 179 // Scripts & Styles. 180 $registration_params = array( 181 'hook' => 'bp_enqueue_scripts', 182 'priority' => 2, 183 ); 184 185 /* 186 * The WordPress Full Site Editing feature needs Scripts 187 * and Styles to be registered earlier. 188 */ 189 if ( current_theme_supports( 'block-templates' ) ) { 190 $registration_params['hook'] = 'bp_init'; 191 $registration_params['priority'] = 20; 192 } 193 194 // Register theme JS. 195 add_action( $registration_params['hook'], array( $this, 'register_scripts' ), $registration_params['priority'] ); 196 197 // Enqueue theme CSS. 198 add_action( 'bp_enqueue_scripts', array( $this, 'enqueue_styles' ) ); 199 200 // Enqueue theme JS. 201 add_action( 'bp_enqueue_scripts', array( $this, 'enqueue_scripts' ) ); 202 203 // Enqueue theme script localization. 204 add_filter( 'bp_enqueue_scripts', array( $this, 'localize_scripts' ) ); 181 205 remove_action( 'bp_enqueue_scripts', 'bp_core_confirmation_js' ); 182 add_action( 'bp_enqueue_scripts', array( $this, 'enqueue_styles' ) ); // Enqueue theme CSS.183 add_action( 'bp_enqueue_scripts', array( $this, 'enqueue_scripts' ) ); // Enqueue theme JS.184 add_filter( 'bp_enqueue_scripts', array( $this, 'localize_scripts' ) ); // Enqueue theme script localization.185 206 186 207 // Body no-js class. -
trunk/src/bp-templates/bp-nouveau/includes/customizer.php
r12537 r13145 4 4 * 5 5 * @since 3.0.0 6 * @version 3.1.06 * @version 10.0.0 7 7 */ 8 8 … … 22 22 $wp_customize->register_control_type( 'BP_Nouveau_Nav_Customize_Control' ); 23 23 $bp_nouveau_options = bp_nouveau_get_appearance_settings(); 24 $layout_widths = bp_nouveau_get_theme_layout_widths(); 24 25 25 26 $wp_customize->add_panel( 'bp_nouveau_panel', array( … … 203 204 ) ); 204 205 205 if ( current_theme_supports( 'align-wide' )) {206 if ( $layout_widths ) { 206 207 $settings['bp_nouveau_appearance[global_alignment]'] = array( 207 208 'index' => 'global_alignment', … … 307 308 $controls = apply_filters( 'bp_nouveau_customizer_controls', $controls ); 308 309 309 if ( current_theme_supports( 'align-wide' )) {310 if ( $layout_widths ) { 310 311 $controls['global_alignment'] = array( 311 312 'label' => __( 'Select the BuddyPress container width for your site.', 'buddypress' ), … … 313 314 'settings' => 'bp_nouveau_appearance[global_alignment]', 314 315 'type' => 'select', 315 'choices' => array( 316 'alignnone' => __( 'Default width', 'buddypress' ), 317 'alignwide' => __( 'Wide width', 'buddypress' ), 318 'alignfull' => __( 'Full width', 'buddypress' ), 319 ), 316 'choices' => $layout_widths, 320 317 ); 321 318 } -
trunk/src/bp-templates/bp-nouveau/includes/functions.php
r13144 r13145 4 4 * 5 5 * @since 3.0.0 6 * @version 9.0.06 * @version 10.0.0 7 7 */ 8 8 … … 1640 1640 return $widget_content; 1641 1641 } 1642 1643 /** 1644 * Retuns the theme layout available widths. 1645 * 1646 * @since 10.0.0 1647 * 1648 * @return array The available theme layout widths. 1649 */ 1650 function bp_nouveau_get_theme_layout_widths() { 1651 $layout_widths = array(); 1652 1653 if ( current_theme_supports( 'align-wide' ) ) { 1654 $layout_widths = array( 1655 'alignnone' => __( 'Default width', 'buddypress' ), 1656 'alignwide' => __( 'Wide width', 'buddypress' ), 1657 'alignfull' => __( 'Full width', 'buddypress' ), 1658 ); 1659 } 1660 1661 // `wp_get_global_settings()` has been introduced in WordPress 5.9 1662 if ( function_exists( 'wp_get_global_settings' ) ) { 1663 $theme_layouts = wp_get_global_settings( array( 'layout' ) ); 1664 1665 if ( isset( $theme_layouts['wideSize'] ) && $theme_layouts['wideSize'] ) { 1666 $layout_widths = array( 1667 'alignnone' => __( 'Content width', 'buddypress' ), 1668 'alignwide' => __( 'Wide width', 'buddypress' ), 1669 ); 1670 } 1671 } 1672 1673 /** 1674 * Filter here to edit the available theme layout widths. 1675 * 1676 * @since 10.0.0 1677 * 1678 * @param array $layout_widths The available theme layout widths. 1679 */ 1680 return apply_filters( 'bp_nouveau_get_theme_layout_widths', $layout_widths ); 1681 } -
trunk/src/bp-templates/bp-nouveau/includes/template-tags.php
r13108 r13145 4 4 * 5 5 * @since 3.0.0 6 * @version 8.0.06 * @version 10.0.0 7 7 */ 8 8 … … 1530 1530 } 1531 1531 1532 $global_alignment = bp_nouveau_get_temporary_setting( 'global_alignment', bp_nouveau_get_appearance_settings( 'global_alignment' ) ); 1533 if ( $global_alignment && 'alignnone' !== $global_alignment && current_theme_supports( 'align-wide' ) ) { 1532 $global_alignment = bp_nouveau_get_temporary_setting( 'global_alignment', bp_nouveau_get_appearance_settings( 'global_alignment' ) ); 1533 $layout_widths = bp_nouveau_get_theme_layout_widths(); 1534 1535 if ( $global_alignment && 'alignnone' !== $global_alignment && $layout_widths ) { 1534 1536 $classes[] = $global_alignment; 1535 1537 }
Note: See TracChangeset
for help on using the changeset viewer.