I have a problem with php 7 syntax. I installed this plugin called simple table manager https://wordpress.org/plugins/simple-table-manager/
and upon activation I got these warnings
Warning: Use of undefined constant list_all - assumed 'list_all' (this will throw an Error in a future version of PHP) in C:\xampp\htdocs\wp2\wp-content\plugins\simple-table-manager\controller.php on line 52
Warning: Use of undefined constant add_new - assumed 'add_new' (this will throw an Error in a future version of PHP) ....
Warning: Use of undefined constant settings - assumed 'settings' (this will throw an Error.....
Warning: Use of undefined constant edit - assumed 'edit' (this will throw an Error.....
the code looks something like this
class Controller {
....
public function add_menu() {
add_menu_page('Simple Table Manager - List', 'Simple Table Manager', 'manage_options', $this->slug['list'], array($this, list_all ));
add_submenu_page(null, 'Simple Table Manager - Add New', 'Add New', 'manage_options', $this->slug['add'], array($this, add_new));
add_submenu_page($this->slug['list'], 'Simple Table Manager - Settings', 'Settings', 'manage_options', $this->slug['settings'], array($this, settings));
add_submenu_page(null, 'Simple Table Manager - Edit', 'Edit', 'manage_options', $this->slug['edit'], array($this, edit));
}
public function list_all() {....}
public function add_new() {...}
public function edit() {...}
public function settings() {...}
}
I have php 7, I'm assuming the syntax used by the developer of the plugin is obsolete
so basically the 4 variables giving errors are actually other functions(methods) of the class itself. what is the correct way to call these methods? I tried array($this, $this->add_new) but it didn't work
I will appreciate it if can help with this.
Thanks in advance