Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
07/04/2011 02:16:25 PM (13 years ago)
Author:
johnjamesjacoby
Message:

Move inline global checks into bp_dtheme_show_notice()

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-themes/bp-default/functions.php

    r4596 r4597  
    521521 * @since 1.2
    522522 */
    523 function bp_dtheme_show_notice() { ?>
     523function bp_dtheme_show_notice() {
     524    global $pagenow;
     525   
     526    // Bail if bp-default theme was not just activated
     527    if ( empty( $_GET['activated'] ) || ( 'themes.php' != $pagenow ) || !is_admin() )
     528        return;
     529   
     530    ?>
     531
    524532    <div id="message" class="updated fade">
    525533        <p><?php printf( __( 'Theme activated! This theme contains <a href="%s">custom header image</a> support and <a href="%s">sidebar widgets</a>.', 'buddypress' ), admin_url( 'themes.php?page=custom-header' ), admin_url( 'widgets.php' ) ) ?></p>
     
    527535
    528536    <style type="text/css">#message2, #message0 { display: none; }</style>
     537
    529538    <?php
    530539}
    531 if ( is_admin() && isset($_GET['activated'] ) && $pagenow == "themes.php" )
    532     add_action( 'admin_notices', 'bp_dtheme_show_notice' );
     540add_action( 'admin_notices', 'bp_dtheme_show_notice' );
    533541endif;
    534542
Note: See TracChangeset for help on using the changeset viewer.