Skip to:
Content

BuddyPress.org

Changeset 5979


Ignore:
Timestamp:
04/13/2012 01:07:56 PM (14 years ago)
Author:
boonebgorges
Message:

Adds support for WP 3.4 theme functions. Fixes #4098. Props chrisclayton

Location:
branches/1.5
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/1.5/bp-core/admin/bp-core-update.php

    r5201 r5979  
    604604
    605605                $installed_plugins = get_plugins();
    606                 $installed_themes  = get_themes();
     606
     607                // Backward-compatibility with WP < 3.4 will be removed in a future release
     608                if ( bp_get_major_wp_version() >= 3.4 ) {
     609                        $installed_themes = wp_get_themes();
     610                } else {
     611                        $installed_themes = get_themes();
     612                }
    607613
    608614                $template_pack_installed = false;
     
    626632
    627633                // Get theme screenshot
    628                 $current_theme = get_current_theme();
     634                // Backward-compatibility with WP < 3.4 will be removed in a future release
     635                if ( bp_get_major_wp_version() >= 3.4 ) {
     636                        $current_theme = wp_get_theme();
     637                } else {
     638                        $current_theme = get_current_theme();
     639                }
    629640                $screenshot    = '';
    630                 $themes        = get_themes();
    631 
    632                 if ( !empty( $themes[$current_theme]['Screenshot'] ) )
     641
     642                if ( !empty( $installed_themes[$current_theme]['Screenshot'] ) )
    633643                        $screenshot = trailingslashit( get_stylesheet_directory_uri() ) . $themes[$current_theme]['Screenshot'];
    634644        ?>
  • branches/1.5/bp-core/bp-core-functions.php

    r5833 r5979  
    377377
    378378        // Get current theme info
    379         $ct = current_theme_info();
     379        // Backward-compatibility with WP < 3.4 will be removed in a future release
     380        if ( bp_get_major_wp_version() >= 3.4 ) {
     381                $ct = wp_get_theme();
     382        } else {
     383                $ct = get_current_theme();
     384        }
    380385
    381386        // The best way to remove this notice is to add a "buddypress" tag to
  • branches/1.5/bp-themes/bp-default/functions.php

    r5629 r5979  
    8383
    8484        // This theme allows users to set a custom background
    85         add_custom_background( 'bp_dtheme_custom_background_style' );
     85        // Backward-compatibility with WP < 3.4 will be removed in a future release
     86        if ( bp_get_major_wp_version() >= 3.4 ) {
     87                $custom_background_args = array(
     88                        'wp-head-callback' => 'bp_dtheme_custom_background_style'
     89                );
     90                add_theme_support( 'custom-background', $custom_background_args );
     91        } else {
     92                add_custom_background( 'bp_dtheme_custom_background_style' );
     93        }
    8694
    8795        // Add custom header support if allowed
     
    99107
    100108                // Add a way for the custom header to be styled in the admin panel that controls custom headers.
    101                 add_custom_image_header( 'bp_dtheme_header_style', 'bp_dtheme_admin_header_style' );
     109                // Backward-compatibility with WP < 3.4 will be removed in a future release
     110                if ( bp_get_major_wp_version() >= 3.4 ) {
     111                        $custom_header_args = array(
     112                                'wp-head-callback' => 'bp_dtheme_header_style',
     113                                'admin-head-callback' => 'bp_dtheme_admin_header_style'
     114                        );
     115                        add_theme_support( 'custom-header', $custom_header_args );
     116                } else {
     117                        add_custom_image_header( 'bp_dtheme_header_style', 'bp_dtheme_admin_header_style' );
     118                }
    102119        }
    103120
     
    181198 */
    182199function bp_dtheme_enqueue_styles() {
    183        
     200
    184201        // Bump this when changes are made to bust cache
    185202        $version = '20120110';
Note: See TracChangeset for help on using the changeset viewer.