Advanced Custom Fields: Field Snitch
[resolved] Fatal error on plugin activation (3 posts)

  1. Augusto
    Posted 1 year ago #

    On plugin activation, wordpress returns an error saying that can not activate the plugin because of a fatal error:

    Parse error: syntax error, unexpected T_FUNCTION in /my/wp/patch/wp-content/plugins/advanced-custom-fields-field-snitch/acf-field-snitch.php on line 47

    WP: 3.9
    ACF: 4.3.7
    ACF Field Snitch: 1.0.3


  2. Augusto
    Posted 1 year ago #

    Just found that this error happens because this plugin requires php 5.3+ (it uses an anonymous function).

    I suggest to put this requirement in the plugin description.

  3. CaliperCreative
    Posted 1 year ago #

    I just got the same error and modified the code to pass a non-anonymous function. Now it works. Replace the add_action() code with the following and it should fix the error:

    function add_snitch() {
    	if (current_user_can('manage_options'))
    		new AcfFieldSnitch();
    add_action('init', 'add_snitch');

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Advanced Custom Fields: Field Snitch
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic