gatsbyjs / wp-gatsby

WordPress plugin for gatsby-source-wordpress

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Call to undefined function WPGatsby\ActionMonitor\Monitors\get_current_screen()

JohannLesacher opened this issue · comments

I'm runing into this error when saving a form created with the acf_form function.
I'm runing a site with a WordPress backend, a WordPress frontend and a Gatsby frontend.

get_current_screen is a backend function and I'm using an ACF form on the WordPress frontend.
The goal of this function is to check if we are on an Option page.
It will always be false from de frontend of WP so I think we should add a conditionnal like :

! function_exists( 'get_current_screen')

to return early if we are not in the context of the WordPress backend.