• Resolved matazone

    (@matazone)


    I think I’m using an old version of PHP on my server, and upgrading to Comic Easel version 1.91 just broke me site. I was getting ‘Unexpected T_Function’ errors for archive_dropdrop.php.

    The problem was with this code at the end of the page:

    add_action( 'widgets_init', function(){
    	register_widget('ceo_comic_archive_dropdown_widget');
    });

    The solution I found was to state the function first, then do the ‘add_action’ after. I overwrote all of those lines with the following:

    // register ceo_comic_archive_dropdown_widget
    function ceo_comic_archive_dropdown_widget() {
        register_widget( 'ceo_comic_archive_dropdown_widget' );
    }
    add_action( 'widgets_init', 'ceo_comic_archive_dropdown_widget' );
    
    /*
    add_action( 'widgets_init', function(){
    	register_widget('ceo_comic_archive_dropdown_widget');
    });
    */

    I kept the old code in a comment at the end, for reference.

    So, if you have this problem, there’s your solution…

    However, you will then get the same error with the next file in the ‘Widgets’ folder. You will need to go through all of the files in that folder and replace the code with the appropriate function statement. To give you an idea of how to continue, the next file is ‘casthover.php’ and ends with this:

    add_action( 'widgets_init', function(){
    	register_widget('ceo_casthover_reference_widget');
    });

    You will need to overwrite it with this:

    // register ceo_casthover_reference_widget
    function ceo_casthover_reference_widget() {
        register_widget( 'ceo_casthover_reference_widget' );
    }
    add_action( 'widgets_init', 'ceo_casthover_reference_widget' );
    
    /*
    add_action( 'widgets_init', function(){
    	register_widget('ceo_casthover_reference_widget');
    });
    */

    I hope that helps a few people…

    Of course, once the plugin updates, it’s going to overwrite my fix probably, which I guess it means I’ll have to do this again, unless the Plugin coders decide to integrate this into their files.

    https://wordpress.org/plugins/comic-easel/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Frumph

    (@frumph)

    Alternatively you update your PHP version on your hosting, generally done in the settings or contact your host.

    https://wordpress.org/about/requirements/

    PHP 5.4 or greater is required for WordPress.

    Plugin Author Frumph

    (@frumph)

    — and 1.9.2 has the compatibility fix in it so that this is not required anymore …

    If you find anything like this, contact me directly or use the http://github.com/Frumph/Comic-Easel page to report it to me please 😉

    Thread Starter matazone

    (@matazone)

    My host is not always very fast at updating PHP versions, and I didn’t know if you were fast at updating the plugin. Clearly you really are very fast!

    Thanks for the quick reply and for the awesome plugin – I’ll use that page in future if I find similar problems 🙂

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Unexpected T_Function fix for Comic Easel version 1.91’ is closed to new replies.