Skip to:
Content

BuddyPress.org

Ticket #4098: 4098.diff

File 4098.diff, 3.9 KB (added by Mamaduka, 12 years ago)
  • bp-core/admin/bp-core-update.php

     
    519519                $installed_plugins = get_plugins();
    520520
    521521                // Backward-compatibility with WP < 3.4 will be removed in a future release
    522                 if ( bp_get_major_wp_version() >= 3.4 ) {
    523                         $installed_themes = wp_get_themes();
    524                 } else {
    525                         $installed_themes = get_themes();
    526                 }
     522                $installed_themes = function_exists( 'wp_get_themes' ) ? wp_get_themes() : get_themes();
    527523
    528524                $bp_themes         = array();
    529525
     
    547543
    548544                // Get theme screenshot
    549545                // Backward-compatibility with WP < 3.4 will be removed in a future release
    550                 if ( bp_get_major_wp_version() >= 3.4 ) {
    551                         $current_theme = wp_get_theme();
    552                 } else {
    553                         $current_theme = get_current_theme();
    554                 }
     546                $current_theme = function_exists( 'wp_get_theme' ) ? wp_get_theme() : get_current_theme();
    555547
    556548                $screenshot    = '';
    557549
  • bp-themes/bp-default/functions.php

     
    8787
    8888        // This theme allows users to set a custom background
    8989        // Backward-compatibility with WP < 3.4 will be removed in a future release
    90         if ( bp_get_major_wp_version() >= 3.4 ) {
     90        if ( function_exists( 'get_custom_header' ) ) {
    9191                $custom_background_args = array(
    9292                        'wp-head-callback' => 'bp_dtheme_custom_background_style'
    9393                );
    9494                add_theme_support( 'custom-background', $custom_background_args );
    9595        } else {
    96                 add_custom_background( 'bp_dtheme_custom_background_style' );
     96                add_custom_background( $custom_background_args['wp-head-callback'] );
    9797        }
    9898
    9999        // Add custom header support if allowed
    100100        if ( !defined( 'BP_DTHEME_DISABLE_CUSTOM_HEADER' ) ) {
    101                 define( 'HEADER_TEXTCOLOR', 'FFFFFF' );
     101                $custom_header_args = array(
     102                        'default-text-color' => 'fff',
     103                        'width' => apply_filters( 'bp_dtheme_header_image_width',  1250 ),
     104                        'height' => apply_filters( 'bp_dtheme_header_image_height', 133  ),
     105                        'wp-head-callback' => 'bp_dtheme_header_style',
     106                        'admin-head-callback' => 'bp_dtheme_admin_header_style'
     107                );
    102108
    103                 // The height and width of your custom header. You can hook into the theme's own filters to change these values.
    104                 // Add a filter to bp_dtheme_header_image_width and bp_dtheme_header_image_height to change these values.
    105                 define( 'HEADER_IMAGE_WIDTH',  apply_filters( 'bp_dtheme_header_image_width',  1250 ) );
    106                 define( 'HEADER_IMAGE_HEIGHT', apply_filters( 'bp_dtheme_header_image_height', 133  ) );
    107 
    108109                // We'll be using post thumbnails for custom header images on posts and pages. We want them to be 1250 pixels wide by 133 pixels tall.
    109110                // Larger images will be auto-cropped to fit, smaller ones will be ignored.
    110                 set_post_thumbnail_size( HEADER_IMAGE_WIDTH, HEADER_IMAGE_HEIGHT, true );
     111                set_post_thumbnail_size( $custom_header_args['width'], $custom_header_args['height'], true );
    111112
    112113                // Add a way for the custom header to be styled in the admin panel that controls custom headers.
    113114                // Backward-compatibility with WP < 3.4 will be removed in a future release
    114                 if ( bp_get_major_wp_version() >= 3.4 ) {
    115                         $custom_header_args = array(
    116                                 'wp-head-callback' => 'bp_dtheme_header_style',
    117                                 'admin-head-callback' => 'bp_dtheme_admin_header_style'
    118                         );
     115                if ( function_exists( 'get_custom_header' ) ) {                 
    119116                        add_theme_support( 'custom-header', $custom_header_args );
    120117                } else {
    121                         add_custom_image_header( 'bp_dtheme_header_style', 'bp_dtheme_admin_header_style' );
     118                        define( 'HEADER_TEXTCOLOR', $custom_header_args['default-text-color'] );
     119                        define( 'HEADER_IMAGE_WIDTH', $custom_header_args['width'] );
     120                        define( 'HEADER_IMAGE_HEIGHT', $custom_header_args['height'] );
     121                        add_custom_image_header( $custom_header_args['wp-head-callback'], $custom_header_args['admin-head-callback'] );
    122122                }
    123123        }
    124124