wordpress plugin custom activation message

时间:2015-06-20 09:41:00

标签: php wordpress-plugin

i created a wordpress plugin .when i activated the plugin i got "plugin activated" flash msg. actually i want to customize this message to "connect to my-plugin" and also provide a link to this plugin settings page. i try

add_action( 'admin_notices', 'your_custom_function' );

function your_custom_function() {

   echo "connect to my-plugin";

    if( $error ) {
        // Put everything here
    }

}

results connect to my-plugin msg shown on every page in admin panel.i just want to show my custom msg only at the time of activation on plugins page only also i got an error The plugin generated 2 characters of unexpected output during activation. If you notice “headers already sent” messages, problems with syndication feeds or other issues, try deactivating or removing this plugin.

1 个答案:

答案 0 :(得分:1)

我想你正在寻找的一个过滤器钩子是plugin_action_links_(plugin_file_name),它允许你在插件页面上为你的插件条目添加自定义链接。

要显示激活消息,请参阅this tutorial

你可以通过自己的研究找到这两个。