Plugin Directory

Changeset 3483992


Ignore:
Timestamp:
03/16/2026 03:18:14 PM (2 weeks ago)
Author:
wordplus
Message:

minor fix to not show other plugin error messages at the top of settings page

Location:
bp-better-messages
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • bp-better-messages/tags/2.14.0/inc/hooks.php

    r3483980 r3483992  
    3838
    3939            add_action( 'admin_notices', array( $this, 'admin_notice') );
     40            add_action( 'in_admin_header', array( $this, 'hide_admin_notices_on_bm_pages' ) );
    4041
    4142            //if( Better_Messages()->settings['fastStart'] == '1' ) {
     
    19361937        }
    19371938
     1939        public function hide_admin_notices_on_bm_pages(){
     1940            $screen = get_current_screen();
     1941            if( ! $screen || strpos( $screen->id, 'better-messages' ) === false ){
     1942                return;
     1943            }
     1944
     1945            remove_all_actions( 'admin_notices' );
     1946            remove_all_actions( 'all_admin_notices' );
     1947        }
     1948
    19381949        public function admin_notice(){
    19391950            $screen = get_current_screen();
  • bp-better-messages/trunk/inc/hooks.php

    r3483980 r3483992  
    3838
    3939            add_action( 'admin_notices', array( $this, 'admin_notice') );
     40            add_action( 'in_admin_header', array( $this, 'hide_admin_notices_on_bm_pages' ) );
    4041
    4142            //if( Better_Messages()->settings['fastStart'] == '1' ) {
     
    19361937        }
    19371938
     1939        public function hide_admin_notices_on_bm_pages(){
     1940            $screen = get_current_screen();
     1941            if( ! $screen || strpos( $screen->id, 'better-messages' ) === false ){
     1942                return;
     1943            }
     1944
     1945            remove_all_actions( 'admin_notices' );
     1946            remove_all_actions( 'all_admin_notices' );
     1947        }
     1948
    19381949        public function admin_notice(){
    19391950            $screen = get_current_screen();
Note: See TracChangeset for help on using the changeset viewer.