Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
04/13/2012 12:59:21 PM (13 years ago)
Author:
boonebgorges
Message:

Adds support for WP 3.4 theme functions. Fixes #4098

File:
1 edited

Legend:

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

    r5868 r5978  
    3232        $this->steps = $this->add_steps();
    3333    }
    34    
     34
    3535    function current_step() {
    3636        if ( isset( $_POST['step'] ) ) {
     
    135135
    136136        // Update or Setup
    137         $type = ( 'update' == bp_get_maintenance_mode() ) ? __( 'Update', 'buddypress' ) : __( 'Setup', 'buddypress' ); 
    138        
     137        $type = ( 'update' == bp_get_maintenance_mode() ) ? __( 'Update', 'buddypress' ) : __( 'Setup', 'buddypress' );
     138
    139139        ?>
    140140
     
    341341                <td>
    342342                    <p><label><input type="radio" name="bp_pages[members]" <?php checked( empty( $existing_pages['members'] ) ); ?>  value="<?php echo $members_slug; ?>" /> <?php _e( 'Automatically create a page at:', 'buddypress' ) ?> <?php echo home_url( $members_slug ); ?>/</label></p>
    343                    
     343
    344344                    <?php if ( $members_page_dropdown = wp_dropdown_pages( "name=bp-blogs-page&echo=0&selected={$existing_pages['members']}&show_option_none=" . __( '- Select -', 'buddypress' ) ) ) : ?>
    345345
     
    359359                    <td>
    360360                        <p><label><input type="radio" name="bp_pages[groups]" <?php checked( empty( $existing_pages['groups'] ) ); ?>  value="<?php echo $groups_slug; ?>" /> <?php _e( 'Automatically create a page at:', 'buddypress' ); ?> <?php echo home_url( $groups_slug ); ?>/</label></p>
    361                        
     361
    362362                        <?php if ( $groups_page_dropdown = wp_dropdown_pages( "name=bp-blogs-page&echo=0&selected={$existing_pages['groups']}&show_option_none=" . __( '- Select -', 'buddypress' ) ) ) : ?>
    363363                            <p><label><input type="radio" name="bp_pages[groups]" <?php checked( !empty( $existing_pages['groups'] ) ); ?> value="page" /> <?php _e( 'Use an existing page:', 'buddypress' ); ?> <?php echo $groups_page_dropdown ?></label></p>
     
    378378                    <td>
    379379                        <p><label><input type="radio" name="bp_pages[blogs]" <?php checked( empty( $existing_pages['blogs'] ) ); ?>  value="<?php echo $blogs_slug; ?>" /> <?php _e( 'Automatically create a page at:', 'buddypress' ); ?> <?php echo home_url( $blogs_slug ); ?>/</label></p>
    380                        
     380
    381381                        <?php if ( $blogs_page_dropdown = wp_dropdown_pages( "name=bp-blogs-page&echo=0&selected={$existing_pages['blogs']}&show_option_none=" . __( '- Select -', 'buddypress' ) ) ) : ?>
    382382                            <p><label><input type="radio" name="bp_pages[blogs]" <?php checked( !empty( $existing_pages['blogs'] ) ); ?> value="page" /> <?php _e( 'Use an existing page:', 'buddypress' ); ?> <?php echo $blogs_page_dropdown ?></label></p>
     
    396396                    <td>
    397397                        <p><label><input type="radio" name="bp_pages[activity]" <?php checked( empty( $existing_pages['activity'] ) ); ?>  value="<?php echo $activity_slug; ?>" /> <?php _e( 'Automatically create a page at:', 'buddypress' ); ?> <?php echo home_url( $activity_slug ); ?>/</label></p>
    398                        
     398
    399399                        <?php if ( $activity_page_dropdown = wp_dropdown_pages( "name=bp-blogs-page&echo=0&selected={$existing_pages['activity']}&show_option_none=" . __( '- Select -', 'buddypress' ) ) ) : ?>
    400400                            <p><label><input type="radio" name="bp_pages[activity]" <?php checked( !empty( $existing_pages['activity'] ) ); ?> value="page" /> <?php _e( 'Use an existing page:', 'buddypress' ); ?> <?php echo $activity_page_dropdown ?></label></p>
     
    414414                    <td>
    415415                        <p><label><input type="radio" name="bp_pages[forums]" <?php checked( empty( $existing_pages['forums'] ) ); ?>  value="<?php echo $forums_slug; ?>" /> <?php _e( 'Automatically create a page at:', 'buddypress' ); ?> <?php echo home_url( $forums_slug ); ?>/</label></p>
    416                        
     416
    417417                        <?php if ( $forums_page_dropdown = wp_dropdown_pages( "name=bp-blogs-page&echo=0&selected={$existing_pages['forums']}&show_option_none=" . __( '- Select -', 'buddypress' ) ) ) : ?>
    418418                            <p><label><input type="radio" name="bp_pages[forums]" <?php checked( !empty( $existing_pages['forums'] ) ); ?> value="page" /> <?php _e( 'Use an existing page:', 'buddypress' ); ?> <?php echo $forums_page_dropdown ?></label></p>
     
    430430                <td>
    431431                    <p><label><input type="radio" name="bp_pages[register]" <?php checked( empty( $existing_pages['register'] ) ); ?>  value="<?php echo $register_slug; ?>" /> <?php _e( 'Automatically create a page at:', 'buddypress' ) ?> <?php echo home_url( $register_slug ) ?>/</label></p>
    432                    
     432
    433433                    <?php if ( $register_page_dropdown = wp_dropdown_pages( "name=bp-blogs-page&echo=0&selected={$existing_pages['register']}&show_option_none=" . __( '- Select -', 'buddypress' ) ) ) : ?>
    434434                        <p><label><input type="radio" name="bp_pages[register]" <?php checked( !empty( $existing_pages['register'] ) ); ?> value="page" /> <?php _e( 'Use an existing page:', 'buddypress' ); ?> <?php echo $register_page_dropdown ?></label></p>
     
    444444                <td>
    445445                    <p><label><input type="radio" name="bp_pages[activate]" <?php checked( empty( $existing_pages['activate'] ) ); ?>  value="<?php echo $activation_slug; ?>" /> <?php _e( 'Automatically create a page at:', 'buddypress' ); ?> <?php echo home_url( $activation_slug ); ?>/</label></p>
    446                    
     446
    447447                    <?php if ( $activate_page_dropdown = wp_dropdown_pages( "name=bp-blogs-page&echo=0&selected={$existing_pages['activate']}&show_option_none=" . __( '- Select -', 'buddypress' ) ) ) : ?>
    448448                        <p><label><input type="radio" name="bp_pages[activate]" <?php checked( !empty( $existing_pages['activate'] ) ); ?> value="page" /> <?php _e( 'Use an existing page:', 'buddypress' ); ?> <?php echo $activate_page_dropdown ?></label></p>
     
    518518
    519519        $installed_plugins = get_plugins();
    520         $installed_themes  = get_themes();
     520
     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        }
     527
    521528        $bp_themes         = array();
    522529
     
    540547
    541548        // Get theme screenshot
    542         $current_theme = get_current_theme();
     549        // 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        }
     555
    543556        $screenshot    = '';
    544         $themes        = get_themes();
    545 
    546         if ( !empty( $themes[$current_theme]['Screenshot'] ) ) {
    547             $screenshot = trailingslashit( get_stylesheet_directory_uri() ) . $themes[$current_theme]['Screenshot'];
     557
     558        if ( !empty( $installed_themes[$current_theme]['Screenshot'] ) ) {
     559            $screenshot = trailingslashit( get_stylesheet_directory_uri() ) . $installad_themes[$current_theme]['Screenshot'];
    548560        } ?>
    549561
     
    882894    function step_theme_save() {
    883895        global $bp;
    884        
     896
    885897        if ( isset( $_POST['submit'] ) && isset( $_POST['theme'] ) ) {
    886898            check_admin_referer( 'bpwizard_theme' );
     
    10331045    function reset_cookie() {
    10341046        @setcookie( 'bp-wizard-step', '', time() - 3600, COOKIEPATH );
    1035     }   
     1047    }
    10361048}
    10371049
     
    10401052 *
    10411053 * @global type $bp
    1042  * @return boolean 
     1054 * @return boolean
    10431055 */
    10441056function bp_get_wizard() {
Note: See TracChangeset for help on using the changeset viewer.