unfulvio / wp-api-menus

:abcd: Menu routes for WordPress JSON REST API.
https://wordpress.org/plugins/wp-api-menus
GNU General Public License v2.0
140 stars 59 forks source link

PHP 5.2 Compatability #26

Closed mckernanin closed 4 years ago

mckernanin commented 8 years ago

I tried to activate this on a site running PHP 5.2.17, and got an error due to the use of anonymous functions. I'm going to try to upgrade the PHP for the site, but you should note in the readme what the minimum tested PHP version is.

Error, for reference:

Parse error: syntax error, unexpected T_FUNCTION, expecting ')' in wp-content/plugins/wp-api-menus/includes/wp-api-menus-v2.php on line 185

https://github.com/unfulvio/wp-api-menus/blob/master/includes/wp-api-menus-v2.php#L185

naylin18 commented 8 years ago

Hi, If you update your php to 5.4, there is no problem. Good luck!

mckernanin commented 8 years ago

@naylin18 thanks, but that's not the point.

apertureless commented 8 years ago

Well the PHP Version is actually defined in the composer.json

"php": ">=5.3.2",

unfulvio commented 8 years ago

@apertureless had included it for wp-packagist support https://wpackagist.org/, WordPress ignores composer.json anyway

mckernanin commented 8 years ago

I'm going to work on this, if this is ever to be merged into / iterated on for WP core, 5.2 support is not optional (no matter how frustrating it may be)