I guess you should be using register_activation_hook()
with the full path including filename, not just the path:
register_activation_hook( plugin_dir_path(__FILE__) . 'test-plugin.php', 'enable_user_registration' );
Related Posts:
- Dynamically Override Fancy Title
- What function to hook for changes made in status and visibility of a post
- WordPress after content Hook & external template part
- get_current_screen() return null
- Adding option to Gallery shortcode
- correct way to call javascript into hook function
- Call to undefined function is_home() or any conditional tags
- Does hooking into a plugin action / filter override the plugin’s function for that hook?
- Template file structure , wordpress hook for altering the template
- get_term_by() returning null on plugin
- Changing Plugin Load Order
- What is an alternative method to the WordPress private _doing_it_wrong() function
- Admin settings update updating every time home page is hit?
- Global Objects and Public Methods
- How should you hook a session_start() when authoring a plugin?
- Customizing subject in comment notification e-mails
- How do you use the plugin boilerplate loader class to hook actions and filters?
- Does WP fire delete_post when trashed posts are automatically deleted?
- Why does do_action pass a blank string as the first parameter if no $arg is set?
- function triggered by “manage_users_custom_column” filter not working
- WordPress plugin how to run function when button is clicked
- How to add a link to WordPress Plugin install Listing
- Shortcodes, output buffering, and WordPress functions
- Call activation hook multiple times
- When to check if a function exists
- Two-step login process – Is it possible?
- How can I hook into existing WordPress Bulk actions?
- Get returned variable from a function to add_shortcode function
- Earliest WP Hook to Safely and Reliably Redirect
- Fatal error: Class not found in
- What is the difference between current_page_parent and current_page_ancestor?
- Define a function outside a class and call the function using action or filter hook
- Create a plugin to change the action to which a function is hooked
- Can I differentiate between “Delete Post Permanently” and “Empty Trash” and do something for each accordingly?
- Synchronize Custom post type tags to WordPress default posts tags
- comment_email hook doesn’t seem to work for comment editor field
- unable to stop loop when using wp_insert_post with publish_post hook
- Hook into theme-switching later than `setup_theme`
- Is it possible to delay execution of shortcode output callback?
- WordPress Ajax callback function from plugin – OOP
- Why my database table not created on activation?
- wp_enqueue_script + wp_enqueue_style Since When
- Act on user meta updated, but only once
- Is there any way to allow a plugin to write over a previous version?
- $content variable – Is this a reserved variable for a WordPress function? – php / wordpress
- Can I change header.php of current theme through a plugin function?
- best practice for query string values – get_query_var always empty for my value supplied in query string
- creating custom function to log actions in plugin
- Modifying meta tags after doing ajax call in plugin
- how to add custom functionality after woocommerce place order button
- How to use output buffering in WordPress hooked functions?
- Conditional hook based on the core function that is calling it
- How to change the hover content of a specific menu item on WordPress?
- Using a post-signup hook to get user details
- How do I update a field of a meta box?
- WordPress function get_the_terms() returns ‘Invalid taxonomy’ error
- Add a new confirmation page before saving
- How dynamic action login_form_{action} is working
- What happens when two or more plugins use the same hook?
- How to get all queries’s results after they have executed?
- wp_get_theme Warning: Illegal offset type
- Add child pages to submenu automatically
- Odd map_meta_cap $args on post edit — sometimes integer, sometimes string
- How can I create a custom plugin that allows anonymous users to signup without registering?
- Associate multiple email addresses with the same user account, so they can log in with either
- Custom filter not working
- Configure WordPress to Generate Scheme-less Relative URLs
- Ajax +wordpress onClick link redirect to new page and create html content
- How to replace settings in WordPress plugin from a theme
- Remove Permalink Meta Box not working?
- Setting post_id for single.php based on URL without a redirect
- using admin functions on frontend
- Modify code for functions.php with specific twitter user url and hashtags
- Creating posts with links from a txt file
- Change the behaviour of a button
- Action / Hook when a new plugin is added
- apply_filters() and call_user_func() to define and call a function outside a class
- Add default value from selection
- The function called on the wp head hook becomes null
- Redirection from a specific page for users logged in but not with membership
- Is there any way to get post meta from publish_post hook?
- I cant add is_admin control to plugin
- Problem in plugin debuging in wordpress
- OOP development and hooks
- Plugin Development – Call to undefined function comment_exists()
- wp_ajax add_action fuction won’t fire on custom jQuery action
- Add_action not calling callback function
- Add function to Dokan ajax class
- plugin not hooking to my custom hook
- Building WordPress Themes With Bootstrap with Adi Purdila → TutsPlus
- Does WordPress have something like timer hook?
- Can I use a hook other than ‘init’ to handle form submissions?
- How can I see a varibles value when my plugin runs?
- How do I replace title with my plugin?
- Looking for Hook that is fired after a plugin or wp upgrade is installed/updated
- Custom options page for themes
- Call do_action() within WordPress cronjob
- Woocommerce: block user removing cart item
- How can I get a plugin to hook ‘dbdelta_queries’ — a filter used during version update?
- Send retrieve password notification email with custom HTML email template