Skip to content

Instantly share code, notes, and snippets.

@stevehenty
Last active May 2, 2018 03:05
Show Gist options
  • Save stevehenty/79364b0e2e029b995ef6 to your computer and use it in GitHub Desktop.
Save stevehenty/79364b0e2e029b995ef6 to your computer and use it in GitHub Desktop.
add_action( 'wp_dashboard_setup', 'sh_dashboard_setup' );
function sh_dashboard_setup() {
wp_add_dashboard_widget( 'sh_gf_dashboard', 'My Gravity Form', 'sh_gf_dashboard' );
}
function sh_gf_dashboard() {
// Make sure the scripts are loaded
// http://www.gravityhelp.com/documentation/gravity-forms/extending-gravity-forms/functions/gravity_form_enqueue_scripts/
gravity_form_enqueue_scripts( 2, true );
// Render the form
//http://www.gravityhelp.com/documentation/gravity-forms/user-guides/getting-started/embedding-a-form/
gravity_form( 2, false, true, false, null, false );
// Or use the shortcode if you prefer
//echo do_shortcode( '[gravityform id=2]' );
}
@lukecav
Copy link

lukecav commented Nov 7, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment