I'm writing a WordPress plugin, OOP-style. Creating tables in the admin interface the native way requires extending another class.
myPlugin.php:
class My_Plugin { public function myMethod(){ return $somedata; } public function anotherMethod(){ require_once('anotherClass.php'); $table = new AnotherClass; $table->yetAnotherMethod(); } } anotherClass.php:
class AnotherClass extends WP_List_Table { public function yetAnotherMethod(){ // how do I get the returned data $somedata here from the method above? // is there a way? // ... more code here ... // table is printed to the output buffer } }
public, therefore it is available in the sub class!$table->yetAnotherMethod($this->myMethod()); ??AnotherClassis not a derived class ofMy_Plugin