{"id":1489971,"date":"2010-05-06T14:20:13","date_gmt":"2010-05-06T14:20:13","guid":{"rendered":"https:\/\/wordpress.org\/support\/topic\/fatal-error-call-to-undefined-function-register_setting-in\/"},"modified":"2016-08-19T17:47:49","modified_gmt":"2016-08-19T17:47:49","slug":"fatal-error-call-to-undefined-function-register_setting-in","status":"closed","type":"topic","link":"https:\/\/wordpress.org\/support\/topic\/fatal-error-call-to-undefined-function-register_setting-in\/","title":{"rendered":"Fatal error: Call to undefined function register_setting() in"},"content":{"rendered":"<p>I&#8217;m rewriting my plugin to use classes. The core code works fine but the admin class gives me still some errors. one of them is:<\/p>\n<p><code>Fatal error: Call to undefined function register_setting() in<\/code><\/p>\n<p>the method i have written is:<\/p>\n<pre><code>\/*\n *\tregister plugin settings\n *\/\nfunction RegisterPluginSettings()\n{\n\/\/ WP: https:\/\/codex.wordpress.org\/Function_Reference\/register_setting\nregister_setting($this-&gt;mPluginSettingsGroup, $this-&gt;mStrPluginOptionsName);\n}<\/code><\/pre>\n<p>do I need to add a global WP variable in this method? I thought register_setting would be available everywhere?<\/p>\n","protected":false},"template":"","class_list":["post-1489971","topic","type-topic","status-closed","hentry"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/1489971","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\/1489971\/revisions"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=1489971"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}