Ticket #8474: 8474.patch
| File 8474.patch, 7.8 KB (added by , 4 years ago) |
|---|
-
src/bp-core/bp-core-template-loader.php
diff --git src/bp-core/bp-core-template-loader.php src/bp-core/bp-core-template-loader.php index eed2d9df5..b270d49f8 100644
function bp_get_query_template( $type, $templates = array() ) { 453 453 */ 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 /** 463 474 * Filters the path to a template file. -
src/bp-templates/bp-nouveau/buddypress-functions.php
diff --git src/bp-templates/bp-nouveau/buddypress-functions.php src/bp-templates/bp-nouveau/buddypress-functions.php index bffb1ce40..98e086513 100644
class BP_Nouveau extends BP_Theme_Compat { 176 176 // We need to neutralize the BuddyPress core "bp_core_render_message()" once it has been added. 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. 187 208 add_filter( 'body_class', array( $this, 'add_nojs_body_class' ), 20, 1 ); -
src/bp-templates/bp-nouveau/includes/customizer.php
diff --git src/bp-templates/bp-nouveau/includes/customizer.php src/bp-templates/bp-nouveau/includes/customizer.php index 7a5bcd9d0..4b675ab9f 100644
3 3 * Code to hook into the WP Customizer 4 4 * 5 5 * @since 3.0.0 6 * @version 3.1.06 * @version 10.0.0 7 7 */ 8 8 9 9 /** … … function bp_nouveau_customize_register( WP_Customize_Manager $wp_customize ) { 21 21 require_once( trailingslashit( bp_nouveau()->includes_dir ) . 'customizer-controls.php' ); 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( 26 27 'description' => __( 'Customize the appearance of BuddyPress Nouveau Template pack.', 'buddypress' ), … … function bp_nouveau_customize_register( WP_Customize_Manager $wp_customize ) { 202 203 ), 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', 208 209 'capability' => 'bp_moderate', … … function bp_nouveau_customize_register( WP_Customize_Manager $wp_customize ) { 306 307 */ 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' ), 312 313 'section' => 'bp_nouveau_general_settings', 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 } 322 319 -
src/bp-templates/bp-nouveau/includes/functions.php
diff --git src/bp-templates/bp-nouveau/includes/functions.php src/bp-templates/bp-nouveau/includes/functions.php index a761586ae..479163ccd 100644
3 3 * Common functions 4 4 * 5 5 * @since 3.0.0 6 * @version 9.0.06 * @version 10.0.0 7 7 */ 8 8 9 9 // Exit if accessed directly. … … function bp_nouveau_render_primary_nav_block( $attributes = array() ) { 1639 1639 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 if ( bp_is_running_wp( '5.9-alpha-20211112.120915' ) ) { 1662 $theme_layouts = wp_get_global_settings( array( 'layout' ) ); 1663 1664 if ( isset( $theme_layouts['wideSize'] ) && $theme_layouts['wideSize'] ) { 1665 $layout_widths = array( 1666 'alignnone' => __( 'Content width', 'buddypress' ), 1667 'alignwide' => __( 'Wide width', 'buddypress' ), 1668 ); 1669 } 1670 } 1671 1672 /** 1673 * Filter here to edit the available theme layout widths. 1674 * 1675 * @since 10.0.0 1676 * 1677 * @param array $layout_widths The available theme layout widths. 1678 */ 1679 return apply_filters( 'bp_nouveau_get_theme_layout_widths', $layout_widths ); 1680 } -
src/bp-templates/bp-nouveau/includes/template-tags.php
diff --git src/bp-templates/bp-nouveau/includes/template-tags.php src/bp-templates/bp-nouveau/includes/template-tags.php index ef5ad0075..7b804a082 100644
3 3 * Common template tags 4 4 * 5 5 * @since 3.0.0 6 * @version 8.0.06 * @version 10.0.0 7 7 */ 8 8 9 9 // Exit if accessed directly. … … function bp_nouveau_container_classes() { 1529 1529 } 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 } 1536 1538