Could someone please help me check the syntax in the following code and why this is giving an error?
I’ve tried updating one of my WordPress files to use the new syntax for function:
{$if=function(){return {$values[‘if’]};};if($if()){$key=$oid;$id=get_queried_object_id();if($id
and$values[‘with-id’]){$key=”{$key}_{$id}”;}break;}}
instead of
{$if=create_function(”,”return {$values[‘if’]};”);if($if()){$key=$oid;$id=get_queried_object_id();if($id
and$values[‘with-id’]){$key=”{$key}_{$id}”;}break;}}
I tried various combinations of adding “;” , however I’m still getting the error: Parse error: syntax error, unexpected token “{“, expecting “;”
Will appreciate any input, thanks.
Marléze Scheepers is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.