register_activation_hook
only fires when plugin is going to active.
You should use your function in add_action('admin_init','your_function_name')
.
Related Posts:
- Is there an action that is called when a post is restored from the trash?
- How to allow an editor to edit all WordPress blog posts but have the last say as administrator?
- Get content and send to 3rd party
- Best collection of code for your 'functions.php' file [closed]
- Manually set global $post vars with an ID, in order to use template tags
- Show a different number of posts per page depending on context (e.g., homepage, search, archive)
- How to Add a Third Level Sub Menu to the WordPress Admin Menu
- How to prevent a post from being deleted?
- How can I make an Ajax login form work with FORCE_SSL_ADMIN enabled?
- Limit access to posts/pages by user roles
- Admin plugin, how can I output a different content-type?
- How can I log a user out of WordPress before the page loads?
- How To Ignore a Filter On Applying Filter the Content In a Function
- Bad Request (Invalid Hostname) on working server, database problem
- How to get posts by content?
- WP get_permalink Return Wrong URL
- Fastest way to loop through all posts?
- post expire after x days
- Set attached to state
- Use plugin or custom post type for game score functionality
- Collaborative post submission [closed]
- Admin Dashboard with Custom Tab for Client
- Bulk Image Uploader to create new post from each image [closed]
- Display comments of users on single page
- wordpress reusable content blocks
- Cannot access wp-admin after disabling all plugin
- Post query – show posts from specified day and month and whole years
- How to send little data between admin pages of my plugin?
- Support for simultaneous editing
- Accessing post’s meta data based on user’s click of a post
- Editing admin pages in WordPress [closed]
- View Private Published Page with URL Code (no login required)
- Layout Plugin Admin Pages: Use BootStrap? [closed]
- The problem with WordPress Importer
- Solutions to repost categories into multisite blogs?
- Is this the right way to execute some PHP in my plugin after a button click on an options page?
- How can I force users to a particular subdomain to log in for MU (Multisite)?
- Display update notification messages like ‘What’s New’
- Display post lists in 2nd paragraph
- WordPress display breadcrumbs using Yoast plugin [closed]
- Preg Match All doesn’t Allow echo first character for WordPress Taxonomy Tags
- Excerpts on category page
- External RSS feed to WordPress Portfolio
- how to add text to posts from tags
- Would Gutenberg be considered a PlugIn?
- pagination on data fetched using SQL query
- How to get the first post and second post in a wordpress blog?
- How do I publish portfolio items with a future date?
- Simply poll & Events Calendar plugins clashing
- WordPress plugin Post Creation [closed]
- Flickering sidebar when scrolling page [closed]
- Where Should i write the code for wordpress ajax voting?
- how to execute some code after a post is published in WordPress [duplicate]
- Post status doesn’t update to ‘future’ every time?
- trigger email when post is published by someone a user follows
- Grab ID from post from plugin and use it to create an object
- WP::is_main_query() Not Working
- Embed PDF into wordpress
- Hook Scripts and Styles in WordPress
- WordPress plugin: Getting posts where checkbox selected
- Plugin permissions for Editor role
- WordPress “Add new tag” button is not working
- Error: Can´t access facebook comment plugin admin page
- how can authors to define custom pages?
- How to add an admin alert for missing plugins
- Problem with ajax plugin for refreshing posts
- Gathering all Custom Post Type posts in to array/object the proper way
- Adding a jQuery modal dialog to the admin area
- Redirect plugin after form submit or show errors
- How to create a plugin page that shows XML?
- How do I allow users to supply a photo/image to be used instead of the grey/white silhouette?
- Update existing post dates to random dates and time
- How to create admin setting for this small plugin
- WC Fix Attributes – ‘Add New’ Not Searchable/Delayed
- Hide all Admin Notices and move on a separate page
- How to display the custom post related blog by category?
- WP Forms not displaying,becomming an fatal error
- WordPress hide post from custom post-type on a single page
- How To Remove “All, Publish, Draft and Expired” in Events Dashboard
- How to echo a PHP Code After the Content
- WordPress Product Detail and catalog
- WordPress CPT Url metabox collection
- Identify if the_post hook is being called from the admin post list
- Include post_date in search
- How to enable Admins to see Plugins
- How to Save settings of custom tab product page in admin side in a database?
- Displaying friend’s posts only
- Trending Tags based on post views
- Hidden Some Setting on Post or Page [duplicate]
- WordPress list child pages of custom post type
- Posts are deleted everyday at night
- Retrieve post thumbnails
- Enforce conditions only for draft posts using WyPiekacz, ignore pending and published posts
- How to create plugin list groups?
- Embedding BitBucket Code in Posting
- What is the recommended way to be notified of security updates to my plugins? [closed]
- Why plugin’s icon for the menu not found?
- Can i have limit posts on a specific category and automatically remove older ones?
- warning wp session
- How to add portfolio category post count in main navigation menu?