Reopen "Deprecated PHP error in latest update 4.6.7 of The Events Calendar"

Home Forums Calendar Products Events Calendar PRO Reopen "Deprecated PHP error in latest update 4.6.7 of The Events Calendar"

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #1432421
    Cynthia Lockley
    Participant

    Reference Ticket https://theeventscalendar.com/support/forums/topic/deprecated-php-error-in-latest-update-4-6-7-of-the-events-calendar/

    I made an edit to a function in my functions.php file as suggested by the deprecated notice but I am still getting the deprecated notice.

    PHP Notice: /wp-content/plugins/the-events-calendar/src/deprecated/TribeEvents.php is deprecated since version 3.10! Use Tribe__Events__Main instead. in /wp-includes/functions.php on line 3966

    The deprecated function is a code snippet provided in the Knowledgebase for “Fixing HTTP 404 errors”. The code snippet is provided in the first bullet under “Less common solutions” and it was working. The snippet is in GitHub at https://gist.github.com/elimn/877bc90421526d22900b

    I have changed
    remove_action( 'init', array( TribeEvents::instance(), 'init' ), 10 );
    add_action( 'init', array( TribeEvents::instance(), 'init' ), 1 );

    to
    Tribe__Events__Template_Factory::asset_package('ajax-calendar');
    Tribe__Events__Template_Factory::asset_package('events-css');

    but I still get the warning notice.

    Does if (class_exists('TribeEvents')) { also need to be changed? Should it be if (class_exists('Tribe__Events__Main')) {?

    I think many users are using this snippet. The GitHub snippet needs to be updated so it doesn’t generate a PHP Notice.

    Note: I have not switched to a different theme or tested plugins because I know the problem is in this snippet.

    #1433977
    Andras
    Keymaster

    Hello Cynthia,

    Thanks for reaching out! That is a great question there!

    Yes, you are right. The ‘if’ clause also needs to be changed.

    Here is the full modified snippet for reference. I tested it and should work with the current versions.

    https://gist.github.com/andrasguseo/b3283cb4503c880a205448dbafc19f7b

    Let me know if this does the trick.

    Cheers,
    Andras

    #1453030
    Support Droid
    Keymaster

    Hey there! This thread has been pretty quiet for the last three weeks, so we’re going to go ahead and close it to avoid confusion with other topics. If you’re still looking for help with this, please do open a new thread, reference this one and we’d be more than happy to continue the conversation over there.

    Thanks so much!
    The Events Calendar Support Team

Viewing 3 posts - 1 through 3 (of 3 total)
  • The topic ‘Reopen "Deprecated PHP error in latest update 4.6.7 of The Events Calendar"’ is closed to new replies.