- Timestamp:
- 11/27/2023 10:55:27 PM (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-templates/bp-nouveau/buddypress-functions.php
r13493 r13652 81 81 } 82 82 83 $this->includes_dir = trailingslashit( $this->dir ) . 'includes/'; 84 $this->directory_nav = new BP_Core_Nav( bp_get_root_blog_id() ); 83 $this->includes_dir = trailingslashit( $this->dir ) . 'includes/'; 84 $this->directory_nav = new BP_Core_Nav( bp_get_root_blog_id() ); 85 $this->is_block_theme = false; 86 87 if ( bp_is_running_wp( '5.9.0', '>=' ) ) { 88 $this->is_block_theme = wp_is_block_theme(); 89 } 85 90 } 86 91 … … 108 113 } 109 114 110 add_action( 'bp_customize_register', function() { 111 if ( bp_is_root_blog() && current_user_can( 'customize' ) ) { 112 require bp_nouveau()->includes_dir . 'customizer.php'; 113 } 114 }, 0 ); 115 // The customizer is only used by classic themes. 116 if ( ! $this->is_block_theme ) { 117 add_action( 118 'bp_customize_register', 119 function() { 120 if ( bp_is_root_blog() && current_user_can( 'customize' ) ) { 121 require bp_nouveau()->includes_dir . 'customizer.php'; 122 } 123 }, 124 0 125 ); 126 } elseif ( wp_using_themes() && ! isset( $_GET['bp_customizer'] ) ) { 127 remove_action( 'customize_register', 'bp_customize_register', 20 ); 128 } 115 129 116 130 foreach ( bp_core_get_packaged_component_ids() as $component ) { … … 150 164 } 151 165 152 bp_set_theme_compat_feature( $this->id, array( 153 'name' => 'cover_image', 154 'settings' => array( 155 'components' => array( 'members', 'groups' ), 156 'width' => $width, 157 'height' => $top_offset + round( $avatar_height / 2 ), 158 'callback' => 'bp_nouveau_theme_cover_image', 159 'theme_handle' => 'bp-nouveau', 160 ), 161 ) ); 166 if ( $this->is_block_theme ) { 167 $width = (int) wp_get_global_settings( array( 'layout', 'contentSize' ) ); 168 } 169 170 bp_set_theme_compat_feature( 171 $this->id, 172 array( 173 'name' => 'cover_image', 174 'settings' => array( 175 'components' => array( 'members', 'groups' ), 176 'width' => $width, 177 'height' => $top_offset + round( $avatar_height / 2 ), 178 'callback' => 'bp_nouveau_theme_cover_image', 179 'theme_handle' => 'bp-nouveau', 180 ), 181 ) 182 ); 183 184 bp_set_theme_compat_feature( 185 $this->id, 186 array( 187 'name' => 'priority_item_nav', 188 'settings' => array( 189 'single_items' => $this->is_block_theme ? array( 'member', 'group' ) : array(), 190 ), 191 ) 192 ); 162 193 } 163 194 … … 253 284 'bp-nouveau' => array( 254 285 'file' => 'css/buddypress%1$s%2$s.css', 'dependencies' => $css_dependencies, 'version' => $this->version, 286 ), 287 'bp-nouveau-priority-nav' => array( 288 'file' => 'css/priority-nav%1$s%2$s.css', 'dependencies' => array( 'dashicons' ), 'version' => $this->version, 255 289 ), 256 290 ) ); … … 354 388 'footer' => true, 355 389 ), 390 'bp-nouveau-priority-menu' => array( 391 'file' => 'js/buddypress-priority-menu%s.js', 392 'dependencies' => array(), 393 'version' => $this->version, 394 'footer' => true, 395 ) 356 396 ) 357 397 );
Note: See TracChangeset
for help on using the changeset viewer.