• Currently I’m getting a fatal error because of the line mentioned above. If I understand this correctly “current_user_can” is only available if “plugins_loaded” is fired. So I guess there is a missing “s” in “plugin_loaded”.

    Best,
    Marc

Viewing 2 replies - 1 through 2 (of 2 total)
  • Can you send me all the log errors LearnPress? We will check this

    Thread Starter Marc_J

    (@marc_j)

    To reproduce the error you can use the following combination of plugins:

    – LearnPress
    – WooCommerce
    – Woo Discount Rules

    This will happen:

    [25-Sep-2020 04:53:57 UTC] PHP Fatal error:  Uncaught Error: Call to undefined function wp_get_current_user() in /wp-includes/capabilities.php:668
    Stack trace:
    #0 /wp-content/plugins/learnpress/inc/admin/class-lp-admin.php(838): current_user_can('manage_options')
    #1 /wp-includes/class-wp-hook.php(287): LP_Admin->get_course_items_of_user_backend(Object(WP_Query))
    #2 /wp-includes/class-wp-hook.php(311): WP_Hook->apply_filters(Object(WP_Query), Array)
    #3 /wp-includes/plugin.php(544): WP_Hook->do_action(Array)
    #4 /wp-includes/class-wp-query.php(1779): do_action_ref_array('pre_get_posts', Array)
    #5 /wp-includes/class-wp-query.php(3448): WP_Query->get_posts()
    #6 /wp-includes/post.php(2053): WP_Query->query(Array)
    #7 /wp-content/plugins/woo-discount-rules/woo-discount-rules.php(35): get_posts(Array)
    #8 in /wp-includes/capabilities.php on line 668
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Is there a typo in inc/admin/class-lp-admin.php:838’ is closed to new replies.