Support » Plugin: Cr3ativ Carousel » PHP errors

  • The plugin works but when checking debug.log I can see that it causes PHP errors: “Methods with the same name as their class will not be constructors in a future version of PHP; cr3ativ_carousel has a deprecated constructor”

    The server runs PHP 7.1

    Any chances that the plugin will be updated soon??

Viewing 2 replies - 1 through 2 (of 2 total)
  • +1

    php error in php 7.2.4

    [31-May-2018 16:05:10 UTC] PHP Deprecated: Function create_function() is deprecated in /var/www/web737/htdocs/domain.de/wp-content/plugins/cr3ativ-carousel/cr3ativ-carousel-widget.php on line 135
    [31-May-2018 16:07:46 UTC] PHP Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; cr3ativ_carousel has a deprecated constructor in /var/www/web737/htdocs/domain.de/wp-content/plugins/cr3ativ-carousel/cr3ativ-carousel-widget.php on line 3

    Fixes for above php deprecated notifications:

    go to file /wp-content/plugins/cr3ativ-carousel/cr3ativ-carousel-widget.php
    find line 135 and modify it like so:

    // register widget
    /* add_action('widgets_init', create_function('', 'return register_widget("cr3ativ_carousel");')); */
    
    // Init Simple Tags widget
    function fixphp72_cr3ativ_carousel_register_widget() {
      return register_widget("cr3ativ_carousel");
    }
      add_action( 'widgets_init', 'fixphp72_cr3ativ_carousel_register_widget' );

    then scroll up to line 6 and modify it like so:

    	// constructor
    	function __construct() {
            parent::__construct(false, $name = __('Carousel Loop', 'cr3atcarousel') );
        }
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘PHP errors’ is closed to new replies.