With the release of Gravity Forms 1.9 it’s now possible to display forms anywhere in WordPress admin. Here’s an example of how to add a Gravity Form to the dashboard like this:
Here’s the code:
With the release of Gravity Forms 1.9 it’s now possible to display forms anywhere in WordPress admin. Here’s an example of how to add a Gravity Form to the dashboard like this:
Here’s the code:
[…] you read my post last week, which demonstrates how to display Gravity Forms in WordPress admin pages, it may have got you […]
Thanks Steven,
Great tutorials and you are truly saving my skin when it comes to extending GF.
Thank you for your feedback Jeremy – I really appreciate it.
The dudes over at GF told me about this… does it go in one’s function file? I tried adding it to a template for a different plugin and it didn’t work. (FYI, I’m using it on a multisite installation, so not sure if the functions file approach would work.)
Yes, it works fine on multisite. Remember forms are site-specific so if you add it to your functions.php file you may want to check the current site first. Something like this: $current_site = get_current_site();
if ( $current_site->domain == ‘mysite.com’ ) {
add_action( ‘wp_dashboard_setup’, ‘sh_dashboard_setup’ );
}
Oh right, DUH. I’m trying to load in a form from the main site into a sub-site. Not gunna work. So thinking I’ll try to load in via an iframe or some such. Thanks for clarifying this!
You might be able to use switch_to_blog($site_id) and restore_current_blog(). https://codex.wordpress.org/WPMU_Functions/switch_to_blog
Still trying to drop into a theme for a plugin and its not working. I know you said it goes in the functions file, but I need it to appear only within that plugin theme template, not the actual dashboard, so maybe this isn’t the approach for me? Sorry, bit ig’nant when it comes to these things… 🙁
That’s right this is just for displaying the form in the admin dashboard.
Hi Steven, congratulations for your outstanding blog.
How do we develop a form like the one you include in this post?
That is, a “summary” form (not a submission one) containing the % of choice per field options (and counts of them) of a form.
Thanks.
OSCAR
Thanks for this post. We are building this into a client’s site so that their employees can login and have custom internal contact forms for human resources. I appreciate you sharing.
Thanks for the feedback Doug – I really appreciate it. You may want to check out my new plugin Gravity Flow for the processes.
This works real well.. I have one form inserted in the admin area.
My question is how can I add 2 forms? Or even 3..
I tried a few different things but I get errors..
Thanks for nay help
Danny