Syntax errors T_FUNCTION, T_PUBLIC
-
Ok the last two JetPack Updates broke my site….the previous one fixed itself after a couple of hours. This one I’m taking a stab at fixing because I have some content scheduled….
Using theme GeneratePress (possibly child theme Freelancer?), WordPress 4.1 I think (I did install 4.1 but had a massive error that I had to go delete some lines of code on, and after that it worked but kept prompting me to install 4.1….I have a lot more content on there now so I have to back it all up before I install 4.1.1, just haven’t had a lot of time.)
Re: Jetpack, I think I’m updating to 3.4 (can’t access dashboard and don’t know how else to tell.)
I had a few errors that I think I was able to remove. But I’m stuck on this one:
Parse error: syntax error, unexpected T_PUBLIC in D:\Hosting\11871272\html\amyhaha\wp-content\plugins\jetpack\class.jetpack.php on line 1145
This is what line 1145 looks like:
public function check_rest_api_compat () {
I deleted it (which is my standard “fix”), but then it came up with this error:
call_user_func_array() expects parameter 1 to be a valid callback, class ‘Jetpack’ does not have a method ‘check_rest_api_compat’ in D:\Hosting\11871272\html\amyhaha\wp-includes\plugin.php on line 505
And line 505 on that page in wp-includes looks like this:
call_user_func_array($the_[‘function’], array_slice($args, 0, (int) $the_[‘accepted_args’]));
So I deleted that, and came up with another
Parse error: syntax error, unexpected T_FUNCTION, expecting T_WHILE in D:\Hosting\11871272\html\amyhaha\wp-includes\plugin.php on line 522
I can keep deleting stuff but that’s probably a bad idea, yeah? I don’t know much about syntax etc, other than basic HTML, but in comparing other public functions in the same document I can’t figure out what is different. I googled “T_FUNCTION ERROR” and stackoverflow says this:
That happens when your PHP is older than 5.3. Anonymous function support wasn’t available until 5.3, so PHP won’t recognize function signatures passed as parameters like that.
…and now I’m lost. I have no idea what that means. There is some more jibber jabber as an example but it doesn’t look anything like what I’m working on, so I wouldn’t want to tinker too much.
To give you an idea of my level of experience, I’m pretty proud of myself that I figured out how to access my control panel and found where the errors were. Pretty sure just deleting them as I did will come back to bite me later, but maybe by then I’ll have enough saved to pay someone…!
Thanks for the help!
- The topic ‘Syntax errors T_FUNCTION, T_PUBLIC’ is closed to new replies.