How to show a message after installing a plugin

Discussion in 'WordPress' started by Imposter, Jun 2, 2012.

  1. #1
    Hey guys, I have a problem with the admin notice action.

    When I am updating the plugin, this function is executed: http://pastebin.com/YWRS7whL (the admin notice action is on line 6) and the message shows up. But when the plugin is being installed, everything else works fine, but no message is displayed: http://pastebin.com/rtm6w2J4 (the admin notice action is on line 4)

    Do you have any idea why? What am I doing wrong?
    Thanks.
     
    Imposter, Jun 2, 2012 IP
  2. mccomf

    mccomf Active Member

    Messages:
    517
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    53
    #2
    Are you using latest wordpress version?
     
    mccomf, Jun 2, 2012 IP
  3. Imposter

    Imposter Peon

    Messages:
    169
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Yes.

    The admin notice hook probably should be somewhere else than in my activation function. But where?
     
    Imposter, Jun 2, 2012 IP
  4. Imposter

    Imposter Peon

    Messages:
    169
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Solved.

    I use the activation hook to save a new option to the database which is regularly checked for possible change. This is probably the only way how to print the message. If anyone knows a better solution, please let me know.
     
    Imposter, Jun 8, 2012 IP