• In both 5.4.4 and 5.4.3 (maybe further back) this plugin is causing issues. It is making other plugins throw the error, Call to undefined function get_current_screen(). It happens with several plugins but only when Events Manager is activated.

    The only way I can get the site to work is to deactivate all other plugins then enable Events Manager.

    Here is a call stack I get

    <br />
    ( ! ) SCREAM: Error suppression ignored for<br />
    ( ! ) Fatal error: Call to undefined function get_current_screen() in D:\Server\htdocs\_Delta\altitude\public_html\wp-content\plugins\wp-e-commerce\wpsc-admin\display-items.page.php on line 493<br />
    Call Stack<br />
    #	Time	Memory	Function	Location<br />
    1	0.0016	868256	{main}( )	..\edit.php:0<br />
    2	0.0025	985744	require_once( 'D:\Server\htdocs\_Delta\altitude\public_html\wp-admin\admin.php' )	..\edit.php:10<br />
    3	0.0030	1011776	require_once( 'D:\Server\htdocs\_Delta\altitude\public_html\wp-load.php' )	..\admin.php:30<br />
    4	0.0035	1030184	require_once( 'D:\Server\htdocs\_Delta\altitude\public_html\wp-config.php' )	..\wp-load.php:29<br />
    5	0.0043	1161664	require_once( 'D:\Server\htdocs\_Delta\altitude\public_html\wp-settings.php' )	..\wp-config.php:83<br />
    6	0.5897	62951192	do_action( )	..\wp-settings.php:306<br />
    7	0.8601	65247304	call_user_func_array ( )	..\plugin.php:406<br />
    8	0.8601	65247336	em_init( )	..\plugin.php:406<br />
    9	0.8682	65841344	em_install( )	..\events-manager.php:484<br />
    10	0.8682	65841392	WP_Rewrite->flush_rules( )	..\em-install.php:5<br />
    11	0.8692	65831592	WP_Rewrite->wp_rewrite_rules( )	..\rewrite.php:1887<br />
    12	0.8702	65831880	WP_Rewrite->rewrite_rules( )	..\rewrite.php:1619<br />
    13	0.9010	65887368	apply_filters( )	..\rewrite.php:1596<br />
    14	0.9012	65888824	call_user_func_array ( )	..\plugin.php:173<br />
    15	0.9012	65888856	EM_Permalinks::rewrite_rules_array( )	..\plugin.php:173<br />
    16	0.9652	66112080	WP_Query->__construct( )	..\em-permalinks.php:160<br />
    17	0.9653	66112080	WP_Query->query( )	..\query.php:3059<br />
    18	0.9654	66113416	WP_Query->get_posts( )	..\query.php:2972<br />
    19	0.9707	66046544	do_action_ref_array( )	..\query.php:1924<br />
    20	0.9708	66047440	call_user_func_array ( )	..\plugin.php:487<br />
    21	0.9708	66047472	wpsc_product_list_exclude_child_categories( )	..\plugin.php:487<br />

    The issue happens somewhere after the Events Manager install process.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Marcus (aka @msykes)

    (@netweblogic)

    not sure why this is happening, but you’d want to look at this:

    D:\Server\htdocs\_Delta\altitude\public_html\wp-content\plugins\wp-e-commerce\wpsc-admin\display-items.page.php on line 493

    the plugin should be ensuring the function exists before calling it. ask them about it, the guys at WP-E-Commerce I believe are proactivate about stuff like this.

    Thread Starter marcusds

    (@marcus1060)

    get_current_screen is a core function of WordPress http://codex.wordpress.org/Function_Reference/get_current_screen – plugins should not have to check for its existance.

    The issue happens with many plugins, not just WP-E-Commerce, that is just one plugin, I removed that plugin and had the issue popup with other plugins.

    The issue seems to be related to the activation process of Events Manager. Sometimes I found if just refreshing after getting the error resolves the issue since EM had a chance to do its install.

    Plugin Author Marcus (aka @msykes)

    (@netweblogic)

    thanks for looking into that.

    I’m guessing the problem is we force a rule flush on install which is executed on the init hook.

    I think the solution would be to remove this line on em-install.php around line 49:

    $wp_rewrite->flush_rules();

    refreshing the page as you describe probably works because that offending line is run after installation is complete. it may however cause issues with permalinks for some EM pages until you resave them.

    I’ve noted this down and will get round to testing that eventually.

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

The topic ‘After activating getting Call to undefined function get_current_screen’ is closed to new replies.