numbersix
Forum Replies Created
Viewing 3 replies - 1 through 3 (of 3 total)
-
Forum: Plugins
In reply to: Errors when using public variables in PHP classes in WordPress pluginsFixed it.
Forum: Plugins
In reply to: Errors when using public variables in PHP classes in WordPress pluginsHehe and further yet AGAIN … this works :
class FacebookRestClient { var $secret; var $session_key; var $api_key; var $friends_list; // to save making the friends.get api call, this will get prepopulated on canvas pages var $added; // to save making the users.isAppAdded api call, this will get prepopulated on canvas pages function __construct($api_key, $secret, $session_key=null) { } }but this doesn’t :
class FacebookRestClient { var $secret; var $session_key; var $api_key; var $friends_list; // to save making the friends.get api call, this will get prepopulated on canvas pages var $added; // to save making the users.isAppAdded api call, this will get prepopulated on canvas pages public function __construct($api_key, $secret, $session_key=null) { } }The only difference between them is the use of the word
publicin the __construct declaration …Forum: Plugins
In reply to: Errors when using public variables in PHP classes in WordPress pluginsFurther to this it seems to be when using ANY variable outside the scope of a local fuction. E.g. the following class declaration works fine.
class FacebookRestClient { function doSomeStuff() { $secret = ""; } }But this doesn’t.
class FacebookRestClient { $secret = ""; }
Viewing 3 replies - 1 through 3 (of 3 total)