When trying to activate my plugin, wordpress comes up with this error:
Plugin could not be activated because it triggered a fatal error.
Parse error: syntax error, unexpected T_FUNCTION
on line 79
The line 79 is the first line of the snippet below, from looking into this I think it is because of a PHP version error, since I have no control over updating php, how would I make it compatible with earlier versions?
add_action('admin_menu', function(){
Plugin_Options::add_menu_page();
});
Most likely, your PHP version is < 5.3. Anonymous functions were added to PHP in 5.3. In order to make use of this, you can pass the function as a callback string like: