error - MetaBoxFavoritePostsget_current_screen() - settings.php 11

Support MB Favorite Posts error - MetaBoxFavoritePostsget_current_screen() - settings.php 11Resolved

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #38971
    Prabakaran ShankarPrabakaran Shankar
    Participant

    Hello,
    After upgrade to wp6.1, wp thrown error "PHP Fatal error: Uncaught Error: Call to undefined function MetaBoxFavoritePostsget_current_screen() in /var/web/site/public_html/wp-content/plugins/mb-favorite-posts/src/Settings.php:11"
    Please look into that.

    #38988
    PeterPeter
    Moderator

    Hello,

    Can you please reinstall this plugin and recheck the issue? And share the server info by going to admin area > Tools > Site Health > Info tab > Server.

    #39006
    Prabakaran ShankarPrabakaran Shankar
    Participant

    Hi,
    Please check your email. I have sent the email with detail error information.

    #39239
    Prabakaran ShankarPrabakaran Shankar
    Participant

    Hi Peter,
    I noticed that the following shortcodes are blocked for unknown reasons either from MB favorites or MB user profile.
    The shortcodes are
    1. [ mb_user_profile_info id="user-details" label_submit="Update Account Details" confirmation="Your information has been changed successfully!" redirect="https://nviewscareer.com/account/setings/" ]
    2. [ mb_user_profile_info id="rwmb-user-info" label_submit="Update Password" confirmation="Your new password has been changed successfully!" redirect="https://nviewscareer.com/account/settings/" ]
    ----- both are in the page https://nviewscareer.com/account/settings/
    3. [ user_profile_content_check ] this shortcode based on the shortcode => mb_frontend_form
    ---- https://nviewscareer.com/account/profile/

    So, wherever, mb_frontend_form or mb_user_profile_info led to an error when MB favorite posts is enabled.

    Please check your mail.

    #39251
    Prabakaran ShankarPrabakaran Shankar
    Participant

    Hi Peter,

    Just now found one temporary solution by adding additional check "is_admin" in the favorite posts core file.
    `
    public function enqueue() {
    if(!is_admin()){ // conditional check to run only on admin page
    return;
    }
    $screen = get_current_screen();
    if ( $screen->id !== 'settings_page_mb-favorite-posts' ) {
    return;
    }

    wp_enqueue_style( 'mbfp-style', MBFP_URL . 'assets/favorite-posts-admin.css', ['wp-components'], '1.1.0' );
    wp_enqueue_script( 'mbfp-script', MBFP_URL . 'assets/favorite-posts-admin.js', [ 'jquery','wp-color-picker', 'wp-color-picker-alpha' ], '1.1.0', true );
    }
    `

    #39612
    Prabakaran ShankarPrabakaran Shankar
    Participant

    Please close this ticket as the issue was automatically resolved on the most recent update (Dec 2022).

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