{"id":849402,"date":"2008-09-03T22:15:08","date_gmt":"2008-09-03T22:15:08","guid":{"rendered":"https:\/\/wordpress.org\/support\/topic\/register_activation_hook-and-global-variables\/"},"modified":"2016-08-19T02:04:43","modified_gmt":"2016-08-19T02:04:43","slug":"register_activation_hook-and-global-variables","status":"closed","type":"topic","link":"https:\/\/wordpress.org\/support\/topic\/register_activation_hook-and-global-variables\/","title":{"rendered":"register_activation_hook and Global Variables"},"content":{"rendered":"<p>Hi,<\/p>\n<p>I am updating my plugin so that it is compatible with wordpress 2.6.<\/p>\n<p>Currently I cannot use any global variables (other than the wordpress core ones) within the <strong>register_activation_hook<\/strong> function hook.<\/p>\n<p>I have documented the whole thing here :<\/p>\n<p><a href=\"http:\/\/blog.mcnicholl.com\/2008\/09\/03\/wordpress-26-register_activation_hook-cannot-see-global-variables\/\">http:\/\/blog.mcnicholl.com\/2008\/09\/03\/wordpress-26-register_activation_hook-cannot-see-global-variables\/<\/a><\/p>\n<p>Its not link\/comment bait&#8230; honest. <\/p>\n<p>Has anyone else noticed this behaviour?<\/p>\n<p>At the link above I created a sample plugin that you can use to replicate the issue.<\/p>\n<p>Is this meant to happen? or am I missing something? I was able to use global variables in this function in WordPress 2.3.2.<\/p>\n<p>Any help would be great.<\/p>\n","protected":false},"template":"","class_list":["post-849402","topic","type-topic","status-closed","hentry","topic-tag-global","topic-tag-register_activation_hook","topic-tag-variables"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/849402","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":0,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/849402\/revisions"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=849402"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}