Take a look at what happens when you activate a plugin. That is, watch the event with something like HttpFox or Wireshark. After activation the page is redirected back to itself with $_GET
parameters appended. For example:
wp-admin/plugins.php?activate=true&plugin_status=all&paged=1&s=
Notice, activate=true
?. Your code isn’t working, I am pretty sure, because there are two requests involved. You will need to compensate for that redirect with, for example, a transient or cookie. You may be able to add your own $_GET
parameter but I do not have the time to research and cook up any of that.
Related Posts:
- Best way to notify WordPress plugin users of new release candidates for beta testing?
- admin_notices not displaying in plugin
- Add notification bubble notice in navigation using transients
- Getting admin notices working for plugin errors
- Call API on post save/update and show the result in admin area
- What is the advantage of using wp_mail?
- Plugin Form Submission Best Practice
- Plugin directory “Last Updated” not changed after initial commit?
- Calling the widget id of a mult-instance widget from inside the widget?
- What is the recommended way to create plugin administration forms?
- Do I need to call do_action in my plugin?
- Fatal error: Call to undefined function wp_mail()
- Does WordPress have an Browser Agent?
- How Do I Load My Action Earlier Enough?
- How to check WordPress website username and password is correct
- How to retrieve a value via get_option when the option_value is stored in a multi-dimensional array?
- I can’t find where a hook is being defined in a plugin – Easy Digital Downloads
- Filter on the_content ignores shortcodes
- Custom theme sufficient or custom plugin neccessary for this feature set?
- Replacing WordPress menu functionality with a plugin
- Check spam in custom form – akismet
- Add Admin Menu Inside Construct or Init
- get plugin directory url
- WordPress cron running twice
- How to create thumbnail of different files?
- Database for development
- PHP library that can merge stylesheet with inline style [closed]
- Admin-ajax.php appending a status code to ajax response
- How to create multiple Gutenberg blocks in one plugin
- How to disable reCaptcha v3 except on Contact Form 7 pages?
- How to get color name in PanelColorSettings in custom Gutenberg block?
- Get Objects While Deleting term
- Fetching the value of forms in WordPress AJAX
- Cannot redeclare function error on the same line
- js/css updating when making a plugin
- How to add setting section in custom post type [closed]
- Get Current Menu Location inside Nav_Walker
- Append country to ‘pretty’ url but serve same page
- Set page template programaticlly in plugin
- Where to add hooks in a class
- Insert terms for custom taxonomy on plugin activation, or each page load (init hook)
- Adding a brand column to WooCommerce Products
- Custom GET Parameters In Plugin’s Admin Page
- Adding option to Gallery shortcode
- WordPress Search filter to remove possible script injections
- Plugin menu addition in multisite
- Mixing and Matching – Custom templates in a WordPress plugin
- Open Graph Object Debugger & url parameters – Page Not Found result
- How to get Metabox custom field to show checked if value is updated using post meta query?
- random code at the end of file after plugin upload
- How Can I add Fields in wp-option table?
- Where do I put my add_action(… and add_filter(… and do I need to remove them?
- How to Move the Comments Bubble to the Right Side of the Toolbar
- How should I go about registering JavaScript that isn’t a file? [duplicate]
- Can’t find where to modify attrbitutes
- How to pull user/author profile data in a plugin?
- Adding columns to core tables
- ajax recursive calls on wordpress returning answers outsite the function scope
- Add Password Generator on password protected page
- WordPress pages are not published due to External database connection with WPDB class
- How to optimize multiple insert into wordpress database
- Injecting HTML on (arbitrary) admin pages
- How to add custom options for plugin into the add post screen – like yoast seo
- How to find where an object first instantiatiation
- Clean way to initialize plugin in newly-added site when plugin has been network activated?
- Listing wordpress users with a search function
- Adjust query on single
- Plugin won’t activate
- dbdelta failing with error: “WordPress database error Table ‘wp_2_myPlugin’ already exists
- Is there any way to pass messages from a script to a redirect target in a hidden fashion?
- What should I pass for $needed_dirs when calling _unzip_file_pclzip (aka PclZip)?
- Custom Path for a Plugin
- Plugin could not be activated because it triggered a fatal error?
- Get cat parameter from admin-ajax
- How to determine primary editor for a page/post
- Using wp_mail to send email?
- Which wp plugin can use Create, Edit and Delete Email address from WordPress Dashboard
- WPGut – Updating failed and shortcode?
- Limit get_next_post to posts from the same author
- How the add_action is included in the plugin development
- how to create a shortcode from a variable in plugin
- Any way, hook to add content right before the “read more” link?
- Error Connecting to Database WHEN Installing WordPress on XAMPP [Tried All the Usual Stuff] (Pics Included)
- How do I ensure I can loop through every enqueued script and CSS?
- Email content as comment
- WordPress use template
- Adding body class in author page for custom role
- Plugins Settings page not updating
- TinyMCE 4.7.11 – Enable hidden WordPress core plugins? (referencing a wp-includes from plugin.php)
- Warning: Illegal string offset – on homepage
- Enqueue scripts based on site.
- My enqueue admin style function doesn’t work because of ?=ver
- WordPress filter custom posts by multi terms of of a taxonomy
- Query only title/field/featured media of posts [closed]
- To remove rendering of menus and header, plugin or theme?
- How can I give access to my plugin sections in admin?
- Displaying External Data – Not Posts
- Making plugin output customizable
- Return all roles, including custom roles
- Mapping multiple URLs to same page