Title: Plugin install
Last modified: August 19, 2016

---

# Plugin install

 *  [night2008](https://wordpress.org/support/users/night2008/)
 * (@night2008)
 * [18 years, 5 months ago](https://wordpress.org/support/topic/plugin-install/)
 * Hi Guys,
 * Im currently working on my first WP plugin and had a question about the register_activation_hook()
   function.
 * My plugin should create 2 DB tables upon activation, so I created my installfunction
   and hooked it in with the register_activation_hook() function:
 * register_activation_hook(‘wp-content/plugins/positioner/position_yourself.php’,’
   positionyourself_install’);
 * I’ve also tried using:
 * register_activation_hook(__FILE__,’positionyourself_install’);
 * My plugin is class based, so I run this function in the php5 constructor. The
   problem is, it doesn’t get called, or the install function has no effect on my
   Database.
 * Now I was wondering if I was doing something wrong? I’ve already looked for tutorials
   how to create plugins, looked @ forums, and more.
 * I hope you guys can help me 🙂

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Thread Starter [night2008](https://wordpress.org/support/users/night2008/)
 * (@night2008)
 * [18 years, 5 months ago](https://wordpress.org/support/topic/plugin-install/#post-669592)
 * OK peeps, my bad.
 * I forgot to pass the reference to my object to my install function.
 * **Working:**
    register_activation_hook(__FILE__,array(&$this,’positionyourself_install’));
 * This topic can be closed!
 *  [whooami](https://wordpress.org/support/users/whooami/)
 * (@whooami)
 * [18 years, 5 months ago](https://wordpress.org/support/topic/plugin-install/#post-669595)
 * so close it — only you have access to the resolved option at the top of thread
   🙂

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Plugin install’ is closed to new replies.

## Tags

 * [register_activation_hook](https://wordpress.org/support/topic-tag/register_activation_hook/)

 * 2 replies
 * 2 participants
 * Last reply from: [whooami](https://wordpress.org/support/users/whooami/)
 * Last activity: [18 years, 5 months ago](https://wordpress.org/support/topic/plugin-install/#post-669595)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
