• Resolved Dave Loodts

    (@davelo)


    My reply on this same topic (https://ww.wp.xz.cn/support/topic/function-_load_textdomain_just_in_time-was-called-incorrectly-151/) was deleted by the moderator. Therefore i make a new ticket, but it’s the same issue.
    I want to highlight that your reply is incorrect. It’s not a WordPress-core issue. Agreed it’s caused by changes in WordPress-core to make translation-loading faster. But that doesn’t mean it’s a WordPress-core issue as plugins are not willing to adapt.

    Agreed, it’s just a PHP Notice, not really a functional break. But your reply about deativating logging so you can’t see the error… is quit bizar advice, no?
    After the WordPress-core decission we saw a lot of plugins struggling with this, after a while the PHP notices became less; so plugin builders are adapting on it.

    So, if you mention you fixed this already. Why do we see still the notice? What excactly did you do in your plugin to prevent this?
    Thanks for your response.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Contributor Md. Ibrahim Khalil

    (@mdibrahimk48)

    The function _load_textdomain_just_in_time was called correctly – you can verify this in the code.

    It was displaying incorrectly due to an unknown WordPress issue. Hope you understand.

    @mdibrahimk48

    I disagree the error says: This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. 

    If we look into your code, this function is not called in an init action, and WC_MMQ::$default_values is not set in any WordPress hook.

    • This reply was modified 6 months, 3 weeks ago by lenny4.
    have-a-byte

    (@have-a-byte)

    mdibrahimk48 is right.
    You should not call any i18n functions like “__” or “_e” before the init action. You are declaring the default values with __(‘…’, ‘woo-min-max-quantity-step-control-single’)

    I fixed your plugin by moving setting the default values to a “init” function.
    But after that you also need to move all the admin init function to a “admin_init” action. If you wish I can send you the fixed wcmmq.php file.

    Plugin Contributor Md. Ibrahim Khalil

    (@mdibrahimk48)

    @have-a-byte Yes, sure. You can Share.

Viewing 4 replies - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.