Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
04/08/2011 09:29:34 PM (14 years ago)
Author:
boonebgorges
Message:

Adds functions for queueing and displaying multiple admin notices at a time. Fixes #3137

File:
1 edited

Legend:

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

    r4107 r4175  
    1010}
    1111add_action( 'in_plugin_update_message-buddypress/bp-loader.php', 'bp_core_update_message' );
    12 
    13 /**
    14  * When BuddyPress is activated we must make sure that mod_rewrite is enabled.
    15  * We must also make sure a BuddyPress compatible theme is enabled. This function
    16  * will show helpful messages to the administrator.
    17  *
    18  * @package BuddyPress Core
    19  */
    20 function bp_core_activation_notice() {
    21     global $wp_rewrite, $wpdb, $bp;
    22 
    23     if ( isset( $_POST['permalink_structure'] ) )
    24         return false;
    25 
    26     if ( !is_super_admin() )
    27         return false;
    28 
    29     if ( !empty( $wpdb->blogid ) ) {
    30         if ( $wpdb->blogid != BP_ROOT_BLOG ) {
    31             return false;
    32         }
    33     }
    34 
    35     if ( empty( $wp_rewrite->permalink_structure ) ) { ?>
    36 
    37         <div id="message" class="updated fade">
    38             <p><?php printf( __( '<strong>BuddyPress is almost ready</strong>. You must <a href="%s">update your permalink structure</a> to something other than the default for it to work.', 'buddypress' ), admin_url( 'options-permalink.php' ) ) ?></p>
    39         </div><?php
    40 
    41     } else {
    42         // Get current theme info
    43         $ct = current_theme_info();
    44 
    45         // The best way to remove this notice is to add a "buddypress" tag to
    46         // your active theme's CSS header.
    47         if ( !defined( 'BP_SILENCE_THEME_NOTICE' ) && !in_array( 'buddypress', (array)$ct->tags ) ) { ?>
    48 
    49             <div id="message" class="updated fade">
    50                 <p style="line-height: 150%"><?php printf( __( "<strong>BuddyPress is ready</strong>. You'll need to <a href='%s'>activate a BuddyPress compatible theme</a> to take advantage of all of the features. We've bundled a default theme, but you can always <a href='%s'>install some other compatible themes</a> or <a href='%s'>update your existing WordPress theme</a>.", 'buddypress' ), network_admin_url( 'themes.php' ), network_admin_url( 'theme-install.php?type=tag&s=buddypress&tab=search' ), network_admin_url( 'plugin-install.php?type=term&tab=search&s=%22bp-template-pack%22' ) ) ?></p>
    51             </div>
    52 
    53         <?php
    54         }
    55     }
    56 }
    57 add_action( 'admin_notices', 'bp_core_activation_notice' );
    5812
    5913/**
Note: See TracChangeset for help on using the changeset viewer.