Ticket #4098: 4098.diff
File 4098.diff, 3.9 KB (added by , 12 years ago) |
---|
-
bp-core/admin/bp-core-update.php
519 519 $installed_plugins = get_plugins(); 520 520 521 521 // 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(); 527 523 528 524 $bp_themes = array(); 529 525 … … 547 543 548 544 // Get theme screenshot 549 545 // 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(); 555 547 556 548 $screenshot = ''; 557 549 -
bp-themes/bp-default/functions.php
87 87 88 88 // This theme allows users to set a custom background 89 89 // 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' ) ) { 91 91 $custom_background_args = array( 92 92 'wp-head-callback' => 'bp_dtheme_custom_background_style' 93 93 ); 94 94 add_theme_support( 'custom-background', $custom_background_args ); 95 95 } else { 96 add_custom_background( 'bp_dtheme_custom_background_style');96 add_custom_background( $custom_background_args['wp-head-callback'] ); 97 97 } 98 98 99 99 // Add custom header support if allowed 100 100 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 ); 102 108 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 108 109 // 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. 109 110 // 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 ); 111 112 112 113 // Add a way for the custom header to be styled in the admin panel that controls custom headers. 113 114 // 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' ) ) { 119 116 add_theme_support( 'custom-header', $custom_header_args ); 120 117 } 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'] ); 122 122 } 123 123 } 124 124