Plugin Directory

Changeset 3457355


Ignore:
Timestamp:
02/09/2026 06:31:11 PM (7 weeks ago)
Author:
botami2025
Message:

Fix: Hide other plugins admin notices on Botami settings page

File:
1 edited

Legend:

Unmodified
Added
Removed
  • botami-chatbot/trunk/botami-chatbot.php

    r3457337 r3457355  
    4141        add_action('admin_init', [$this, 'register_settings']);
    4242        add_action('admin_enqueue_scripts', [$this, 'enqueue_admin_assets']);
     43        add_action('admin_head', [$this, 'hide_other_admin_notices'], 1);
    4344
    4445        // AJAX hooks pour vérifier la clé API
     
    7879            'default' => ''
    7980        ]);
     81    }
     82
     83    /**
     84     * Masquer les notices des autres plugins sur la page Botami
     85     */
     86    public function hide_other_admin_notices() {
     87        $screen = get_current_screen();
     88        if ($screen && $screen->id === 'toplevel_page_botami-settings') {
     89            remove_all_actions('admin_notices');
     90            remove_all_actions('all_admin_notices');
     91        }
    8092    }
    8193
Note: See TracChangeset for help on using the changeset viewer.