Support Forum
Support › MB Favorite Posts › error - MetaBoxFavoritePostsget_current_screen() - settings.php 11Resolved
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.
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.
Hi,
Please check your email. I have sent the email with detail error information.
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.
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 );
}
`
Please close this ticket as the issue was automatically resolved on the most recent update (Dec 2022).