i wrote a plugin and it successfully works on my localhost.But when i install it my server and want to activate it fails.
Plugin could not be activated because it triggered a fatal error.
Parse error: syntax error, unexpected T_FUNCTION in /home/ozcanco/public_html/said/wp-content/plugins/Archive/my-plugin.php on line 22
But when i run this plugin on my local it successfully works.By the way my wordpress versions are same,on local and server.How come this happen?
The line 22 is like that:
add_action('loop_start', function($query) use ($allContent){