Tagged: 

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #813998

    Hi,

    I’m using WP-CLI to maintain my websites and I keep getting PHP notices produced by Enfold, which is a bit annoying, cause they obscure the output I’m interested in.

    I found out that the problem is caused by false assumption that file enfold/framework/avia_framework.php will be always included in global scope and thus all variables declared in it will be global. This is not true in case of WP-CLI, because WP-CLI bootstraps WordPress in local scope.

    The solution is to declare global variables via $GLOBALS array. In other words, instead of: $avia = new avia_superobject($avia_base_data);

    You should use: $GLOBALS['avia'] = new avia_superobject($avia_base_data);

    Alternative solution is to make sure no “actual” code is run directly on inclusion (ie. every functionality is hooked to proper hook). Currently, this is not true for example in case of enfold/includes/admin/register-widget-area.php as this file is directly included by functions.php and makes call to avia_get_option which references global $avia (which is not always global as explained above).

    I would appreciate if you could relate this feedback to your dev team :)

    Cheers,
    Česlav

    #814958

    Hey Česlav,

    Thanks for contacting us and for sharing!

    We will report it to our devs :)

    Best regards,
    Yigit

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.