ninja_forms_get_all_forms
The Ninja Forms ninja forms get all function.
Description
ninja_forms_get_all_forms( (bool) $debug = false );
Parameters (1)
- 0. $debug — Optional. (bool) =>
false
- The debug.
Usage
if ( !function_exists( 'ninja_forms_get_all_forms' ) ) { require_once ABSPATH . PLUGINDIR . 'ninja-forms/deprecated/includes/deprecated.php'; } // The debug. $debug = false; // NOTICE! Understand what this does before running. $result = ninja_forms_get_all_forms($debug);
Defined (2)
The function is defined in the following location(s).
- /deprecated/includes/deprecated.php
- function ninja_forms_get_all_forms( $debug = false ) {
- $forms = Ninja_Forms()->forms()->get_all();
- $tmp_array = array();
- $x = 0;
- foreach ( $forms as $form_id ) {
- $tmp_array[ $x ]['id'] = $form_id;
- $tmp_array[ $x ]['data'] = Ninja_Forms()->form( $form_id )->get_all_settings();
- $tmp_array[ $x ]['name'] = Ninja_Forms()->form( $form_id )->get_setting( 'form_title' );
- $x++;
- }
- return $tmp_array;
- }
- /includes/deprecated.php
- function ninja_forms_get_all_forms() {
- // Ninja_Forms::deprecated_notice( 'ninja_forms_get_all_forms', '3.0', 'Ninja_Forms()->form()->get_forms()', debug_backtrace() );
- $forms = array();
- foreach( Ninja_Forms()->form()->get_forms() as $form ) {
- $forms[] = array(
- 'id' => $form->get_id(),
- 'data' => $form->get_settings(),
- 'name' => $form->get_setting( 'title' )
- );
- }
- return $forms;
- }