Skip to content

Instantly share code, notes, and snippets.

@kjohnson
Last active March 8, 2017 15:24
Show Gist options
  • Select an option

  • Save kjohnson/62162dbc5bf8d52b1ef88bb1a641810f to your computer and use it in GitHub Desktop.

Select an option

Save kjohnson/62162dbc5bf8d52b1ef88bb1a641810f to your computer and use it in GitHub Desktop.
<?php
$form_id = 1;
// Check which version of Ninja Forms.
if( ! get_option( 'ninja_forms_load_deprecated', FALSE ) ){
// Ninja Forms THREE.
// Check if Ninja Forms is loaded.
if( function_exists( 'Ninja_Forms' ) ){
// Output form by ID.
Ninja_Forms()->display( $form_id );
}
} else {
// Ninja Forms v2.9.x (DEPRECATED).
// Check if the Ninja Forms display function exists.
if( function_exists( 'ninja_forms_display_form' ) ){
// Output the form by ID.
ninja_forms_display_form( $form_id );
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment