<?xml version="1.0" encoding="UTF-8"?><!-- generator="bbPress" -->

<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
>

<channel>
<title>WordPress &#8250; Support Topic: register_activation_hook JUST WON'T WORK</title>
<link>http://wordpress.org/support/</link>
<description>WordPress &#8250; Support Topic: register_activation_hook JUST WON'T WORK</description>
<language>en</language>
<pubDate>Wed, 25 Nov 2009 23:43:09 +0000</pubDate>

<item>
<title>apljdi on "register_activation_hook JUST WON'T WORK"</title>
<link>http://wordpress.org/support/topic/266063#post-1226680</link>
<pubDate>Sun, 27 Sep 2009 16:38:09 +0000</pubDate>
<dc:creator>apljdi</dc:creator>
<guid isPermaLink="false">1226680@http://wordpress.org/support/</guid>
<description>&#60;p&#62;From inside a PHP class in a plugin, this works for me:&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;register_activation_hook(ABSPATH.PLUGINDIR.&#38;#39;/&#38;lt;pluginfoldername&#38;gt;/&#38;lt;pluginname&#38;gt;.php&#38;#39;,array(&#38;amp;$this,&#38;#39;&#38;lt;functiontorun&#38;gt;&#38;#39;));&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;gesman's code looks to me to be essentially the but is not inside a class.&#60;/p&#62;
&#60;p&#62;You should also think about whether it is register_activation_hook that is failing or the function being called that is failing. This bit from gesman's link is a very good way to start sorting that out:&#60;/p&#62;
&#60;blockquote&#62;&#60;p&#62;// If you want to quickly test if your activation hook works - put exit() into it. At least you'll see error during activation.
&#60;/p&#62;&#60;/blockquote&#62;</description>
</item>
<item>
<title>gesman on "register_activation_hook JUST WON'T WORK"</title>
<link>http://wordpress.org/support/topic/266063#post-1226617</link>
<pubDate>Sun, 27 Sep 2009 15:04:29 +0000</pubDate>
<dc:creator>gesman</dc:creator>
<guid isPermaLink="false">1226617@http://wordpress.org/support/</guid>
<description>&#60;p&#62;See my post with sample of working code here:&#60;br /&#62;
&#60;a href=&#34;http://wordpress.org/support/topic/312342?replies=2#post-1226615&#34; rel=&#34;nofollow&#34;&#62;http://wordpress.org/support/topic/312342?replies=2#post-1226615&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;Gleb
&#60;/p&#62;</description>
</item>
<item>
<title>mgtonelli on "register_activation_hook JUST WON'T WORK"</title>
<link>http://wordpress.org/support/topic/266063#post-1208591</link>
<pubDate>Fri, 11 Sep 2009 19:45:11 +0000</pubDate>
<dc:creator>mgtonelli</dc:creator>
<guid isPermaLink="false">1208591@http://wordpress.org/support/</guid>
<description>&#60;p&#62;got the same issue, did any of you guys found a solution or had implemented a work around to make it work???&#60;/p&#62;
&#60;p&#62;need to create tables on the DB, not able to do that since 'register_activation_hook' just doesn't work..&#60;/p&#62;
&#60;p&#62;regards..
&#60;/p&#62;</description>
</item>
<item>
<title>lexayo on "register_activation_hook JUST WON'T WORK"</title>
<link>http://wordpress.org/support/topic/266063#post-1125148</link>
<pubDate>Fri, 03 Jul 2009 18:47:52 +0000</pubDate>
<dc:creator>lexayo</dc:creator>
<guid isPermaLink="false">1125148@http://wordpress.org/support/</guid>
<description>&#60;p&#62;me too&#60;br /&#62;
so i do this :&#60;/p&#62;
&#60;p&#62;function silex_activation_hook(){&#60;br /&#62;
    .................&#60;br /&#62;
}&#60;/p&#62;
&#60;p&#62;// does not work =&#38;gt; call it directly register_activation_hook( __FILE__, 'silex_activation_hook');&#60;br /&#62;
if ($_GET['activate'] == true)&#60;br /&#62;
{&#60;br /&#62;
	silex_activation_hook();&#60;br /&#62;
}
&#60;/p&#62;</description>
</item>
<item>
<title>god0fgod on "register_activation_hook JUST WON'T WORK"</title>
<link>http://wordpress.org/support/topic/266063#post-1119324</link>
<pubDate>Sun, 28 Jun 2009 12:45:56 +0000</pubDate>
<dc:creator>god0fgod</dc:creator>
<guid isPermaLink="false">1119324@http://wordpress.org/support/</guid>
<description>&#60;p&#62;Oh, and the table isn't created.
&#60;/p&#62;</description>
</item>
<item>
<title>god0fgod on "register_activation_hook JUST WON'T WORK"</title>
<link>http://wordpress.org/support/topic/266063#post-1119319</link>
<pubDate>Sun, 28 Jun 2009 12:43:52 +0000</pubDate>
<dc:creator>god0fgod</dc:creator>
<guid isPermaLink="false">1119319@http://wordpress.org/support/</guid>
<description>&#60;p&#62;It's the same with me. What the heck is wrong with it. I tried looking for any output in the source but it isn't there:&#60;/p&#62;
&#60;p&#62;Nothing from &#34;echo &#34;DBINFO:&#34; . dbDelta($sql);&#34; here. Only the relevant parts were copied.&#60;br /&#62;
&#38;lt;?&#60;br /&#62;
function create_links_table(){&#60;br /&#62;
	//Create link table&#60;br /&#62;
	global $wpdb;&#60;br /&#62;
	$table_name = $wpdb-&#38;gt;prefix . &#34;fim_links&#34;;&#60;br /&#62;
	if($wpdb-&#38;gt;get_var(&#34;SHOW TABLES LIKE '$table_name'&#34;) != $table_name) {&#60;br /&#62;
		$sql = &#34;CREATE TABLE &#34; . $table_name . &#34; (&#60;br /&#62;
		order mediumint(9) NOT NULL AUTO_INCREMENT,&#60;br /&#62;
		href text DEFAULT '#' NOT NULL,&#60;br /&#62;
		id text DEFAULT '0' NOT NULL,&#60;br /&#62;
		block mediumint(9) DEFAULT '1' NOT NULL,&#60;br /&#62;
		PRIMARY KEY order (order)&#60;br /&#62;
		);&#34;;&#60;br /&#62;
		require_once(ABSPATH . 'wp-admin/includes/upgrade.php');&#60;br /&#62;
		echo &#34;DBINFO:&#34; . dbDelta($sql);&#60;br /&#62;
		$sql = &#34;INSERT INTO &#34; . $table_name .&#60;br /&#62;
            &#34; (href, id) &#34; .&#60;br /&#62;
            &#34;VALUES ('http://crytekuk.info','link_example')&#34;;&#60;br /&#62;
		$wpdb-&#38;gt;query($sql);&#60;br /&#62;
	}&#60;br /&#62;
}&#60;br /&#62;
function setup_fim(){&#60;br /&#62;
	setup_themes();&#60;br /&#62;
	add_option(&#34;fim_version&#34;,FIM_VERSION);&#60;br /&#62;
	add_option(&#34;fim_widgets&#34;,&#34;links,ajax_login&#34;);&#60;br /&#62;
	create_links_table();&#60;br /&#62;
}&#60;br /&#62;
register_activation_hook(__FILE__, &#34;setup_fim&#34;);&#60;br /&#62;
?&#38;gt;
&#60;/p&#62;</description>
</item>
<item>
<title>lucasrcosta on "register_activation_hook JUST WON'T WORK"</title>
<link>http://wordpress.org/support/topic/266063#post-1059052</link>
<pubDate>Tue, 28 Apr 2009 16:18:36 +0000</pubDate>
<dc:creator>lucasrcosta</dc:creator>
<guid isPermaLink="false">1059052@http://wordpress.org/support/</guid>
<description>&#60;p&#62;All of these do NOT WORK. What I'm I missing?&#60;/p&#62;
&#60;p&#62;register_activation_hook(__FILE__,'teste');&#60;br /&#62;
register_deactivation_hook(__FILE__, 'teste');&#60;br /&#62;
register_activation_hook(__FILE__,array(&#38;amp;$this,'teste'));&#60;br /&#62;
register_deactivation_hook(__FILE__,array(&#38;amp;$this,'teste'));&#60;/p&#62;
&#60;p&#62;function teste() {&#60;br /&#62;
	echo &#34;A Simple echo function to see if it works&#34;;&#60;br /&#62;
}
&#60;/p&#62;</description>
</item>

</channel>
</rss>
