Changeset 12188
- Timestamp:
- 07/10/2018 05:19:14 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-core/bp-core-attachments.php
r11904 r12188 975 975 */ 976 976 function bp_attachments_get_template_part( $slug ) { 977 $attachment_template_part = 'assets/_attachments/' . $slug; 978 979 // Load the attachment template in WP Administration screens. 980 if ( is_admin() && ( ! defined( 'DOING_AJAX' ) || ! DOING_AJAX ) ) { 981 $attachment_admin_template_part = buddypress()->themes_dir . '/bp-legacy/buddypress/' . $attachment_template_part . '.php'; 982 983 // Check whether the template part exists. 984 if ( ! file_exists( $attachment_admin_template_part ) ) { 985 return false; 986 } 987 988 // Load the template part. 989 require( $attachment_admin_template_part ); 990 991 // Load the attachment template in WP_USE_THEMES env. 992 } else { 993 bp_get_template_part( $attachment_template_part ); 977 $switched = false; 978 979 /* 980 * Use bp-legacy attachment template part for older bp-default themes or if in 981 * admin area. 982 */ 983 if ( ! bp_use_theme_compat_with_current_theme() || ( is_admin() && ( ! defined( 'DOING_AJAX' ) || ! DOING_AJAX ) ) ) { 984 $current = bp_get_theme_compat_id(); 985 if ( 'legacy' !== $current ) { 986 $switched = true; 987 bp_setup_theme_compat( 'legacy' ); 988 } 989 } 990 991 // Load the template part. 992 bp_get_template_part( 'assets/_attachments/' . $slug ); 993 994 if ( $switched ) { 995 bp_setup_theme_compat( $current ); 994 996 } 995 997 }
Note: See TracChangeset
for help on using the changeset viewer.