When I use gravity_form via PHP to embed a form while in /wp-admin/ (it's in a thickbox inline popup) it appears to not function as expected. This is likely because it wasn't meant to be displayed in /wp-admin/ -- are there any workarounds?
When I use gravity_form via PHP to embed a form while in /wp-admin/ (it's in a thickbox inline popup) it appears to not function as expected. This is likely because it wasn't meant to be displayed in /wp-admin/ -- are there any workarounds?
I don't think this has ever been tested. We will have to take a look and see what it is going on.
It appears to be the form 'editor' without the script / styles to properly edit. (Edit / Delete buttons all over, disabled fields, etc..)
BTW, this seems to be the result of an is_admin() check.
The script enqueue function also won't work for the same reason (does a !is_admin() check)
Yes, the enqueue does an !is_admin check so it doesn't enqueue the scripts in the admin area. We will look into this and see what can be done to make the function calls work in the admin. It may require an additional parameter be added to tell it it's being used in the admin.
Perhaps something like this would be better:
if (!is_admin() || (is_admin() && isset($_GET['page']) && (false === strpos($_GET['page'], 'gf_') || 0 < strpos($_GET['page'], 'gf_'))) {
// show regular form or enqueue scripts / styles depending on the function
}
ScOttkclark... did you get this to work.. i am trying the same thing... if so what file does the code go in....
I started this thread on got directed here.. thanks
In case Scott does not check in here, you can contact him at his website:
Scott Kingsley Clark
http://scottkclark.com