How do I disable a nag message?

Home Forums Calendar Products Events Calendar PRO How do I disable a nag message?

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #1195257
    Paul
    Participant

    Hello,

    We regularly add administrators to our website. These ‘admin’ accounts are heavily modified using a User Role Editor plugin so they only have access to certain features.

    Every time we add one of these admin accounts, they get the message, ‘Pssst! Looking for the filters? They live in a separate plugin now | Download for free | Dismiss’.

    The dismiss link can be clicked and the message will disappear but to a new admin, the message is not relevant and can be puzzling.

    Is there a way to prevent this nag message completely?

    Thank you!

    Paul.

    #1195550
    George
    Participant

    Hey Paul,

    Thanks for reaching out.

    What you’re trying to do here may indeed be possible, but unfortunately only by way of some custom code. I wrote a custom code snippet for you here:

    add_action( 'user_register', 'tribe_disable_apm_plugi_nag_for_users', 10, 1 );

    function tribe_disable_apm_plugi_nag_for_users( $user_id ) {
    $user_id = absint( $user_id );

    if ( $user_id && intval( $user_id ) > 0 ) {
    update_user_meta( $user_id, '_tribe_apm_plugin_nag', true );
    }
    }

    ☝️ Try adding this to your theme’s functions.php file and see if this helps prevent the presence of that notice for new users. This could should disable that upon the creation of a new user account in WordPress.

    — George

    #1196348
    Paul
    Participant

    Hi George,

    Many thanks for your code which I have inserted into my functions.php file.

    I noticed it did not disable the message for our existing admin users so I created a new account via the back-end to see if it disabled the message for new accounts only. Unfortunately the nag message was still there for the new account.

    I have about 10 custom snippets in my child theme functions.php file which all work as expected, so I am familiar with this process but I cannot seem to get your code to work 🙁

    Does your code disable the nag message only if a user registers via the front-end, or should this work if an existing admin creates a new user in the back-end?

    Thank you.

    Paul.

    • This reply was modified 9 years, 5 months ago by Paul. Reason: Typographical error
    #1196645
    George
    Participant

    Hi Paul,

    Sorry to hear this didn’t help yet.

    What you’re trying to do here may indeed be possible, but unfortunately only by way of some custom code. We cannot help with custom coding, as per our support policy here, so I won’t be able to troubleshooting this snippet and help get it working as ideally as possible. Check out our support policy here for more information on this → https://theeventscalendar.com/knowledgebase/what-support-is-provided-for-license-holders/

    I wrote a custom snippet despite all this because I thought it would help, so hopefully the snippet at least gets you started.

    You’ll have to take the reins from here on writing custom code to hide these messages; I have, in the meantime, created a bug ticket so that we can hide this in the future for non-Administrator-level users.

    For now, though, some ideas/responses:

    • The snippet I shared above hooks to the user_register WordPress hook, which you can read about here: https://codex.wordpress.org/Plugin_API/Action_Reference/user_register This action fires upon user creation so it doesn’t matter if it’s a front-end registration or back-end.

    • Instead of using the user_register hook, you may find some luck by looking at other WordPress actions and seeing if they provide hooks of their own. Here are some examples to check out:

    • You may also find some success by filtering the main admin_notices hook in the first place, which is the hook all admin nag messages use to display at the top of the page. You can learn more about this here → https://codex.wordpress.org/Plugin_API/Action_Reference/admin_notices

    I apologize that I wasn’t able to put together a fully-working snippet here; I hope the resources I’ve shared above help you take the reins on continuing to tinker with custom code.

    I’ll close this thread for now. Open a new thread any time if other issues or questions arise.

    And just to reiterate, I have logged this as a bug and so hopefully in an upcoming release of our plugins this message will only show for Administrator level users, not any user level lower than that (because these users can’t update/install plugins anyways, so they shouldn’t see the message!)

    I will update this thread with news on that bug fix when news is available. If there’s not update from me on this thread about it, there is no news—but if there is news, I’ll post here.

    Sorry for the trouble here,
    George

    #1299078
    Nico
    Member

    Hey,

    Just wanted to share with you that a new maintenance release (for the Week of 12th June 2017) is out, including a fix for this issue ?

    Basically the notice will just show to users that can install plugins.

    Find out more about this release → https://theeventscalendar.com/maintenance-release-for-the-week-of-12th-june-2017/

    Please update the plugins and let us know if the fix works for your site,
    Best,
    Nico

    #1317858
    Support Droid
    Keymaster

    Hey there! This thread has been pretty quiet for the last three weeks, so we’re going to go ahead and close it to avoid confusion with other topics. If you’re still looking for help with this, please do open a new thread, reference this one and we’d be more than happy to continue the conversation over there.

    Thanks so much!
    The Events Calendar Support Team

Viewing 6 posts - 1 through 6 (of 6 total)
  • The topic ‘How do I disable a nag message?’ is closed to new replies.