Skip to:
Content

BuddyPress.org

Ticket #8599: 8599.patch

File 8599.patch, 1.4 KB (added by imath, 2 years ago)
  • src/bp-core/classes/class-bp-admin.php

    diff --git src/bp-core/classes/class-bp-admin.php src/bp-core/classes/class-bp-admin.php
    index b825da41c..cc64f593f 100644
    class BP_Admin { 
    388388                 */
    389389                do_action_ref_array( 'bp_admin_submenu_pages', array( &$this->submenu_pages ) );
    390390
    391                 foreach( $this->submenu_pages as $subpage_hooks ) {
     391                foreach( $this->submenu_pages as $subpage_type => $subpage_hooks ) {
    392392                        foreach ( $subpage_hooks as $subpage_hook ) {
    393393                                add_action( "admin_print_styles-{$subpage_hook}", array( $this, 'add_inline_styles' ), 20 );
     394
     395                                // When BuddyPress is activated on the network, the settings screens need an admin notice when settings have been updated.
     396                                if ( is_network_admin() && bp_is_network_activated() && 'settings' === $subpage_type && 'settings_page_bp-credits' !== $subpage_hook ) {
     397                                        add_action( "load-{$subpage_hook}", array( $this, 'admin_load' ) );
     398                                }
    394399                        }
    395400                }
    396401        }
    class BP_Admin { 
    581586                ) );
    582587        }
    583588
     589        /**
     590         * Displays an admin notice to inform settings have been saved.
     591         *
     592         * The notice is only displayed inside the Network Admin when
     593         * BuddyPress is network activated.
     594         *
     595         * @since 10.0.0
     596         */
     597        public function admin_load() {
     598                if ( ! isset( $_GET['updated'] ) ) {
     599                        return;
     600                }
     601
     602                bp_core_add_admin_notice( __( 'Settings saved.', 'buddypress' ), 'updated' );
     603        }
     604
    584605        /**
    585606         * Add some general styling to the admin area.
    586607         *