How to display notice in admin panel on Plugin Activation?

前端 未结 6 2026
我寻月下人不归
我寻月下人不归 2020-12-02 19:27

I am trying to display a notice in admin panel when I activate my test plugin.
How can I display that? What\'s that method?

6条回答
  •  星月不相逢
    2020-12-02 19:52

    I've developed amarkal-admin-notification - a script that lets you add static/dismissible admin notices and handles the dismissal for you. This script is a module within the Amarkal WordPress framework.

    For example:

    amarkal_admin_notification( 'my-error-notice', __('Oh snap! This is an error message.','slug'), 'error');
    

提交回复
热议问题