Actions

Retrieving the Action Model

<?php
// Returns an Action Model for Action ID 1
Ninja_Forms()->form()->action( 1 )->get();
// Returns an Action Model for Action ID 1
Ninja_Forms()->form()->get_action( 1 );
// Returns an array of Action Models for Form ID 1
Ninja_Forms()->form( 1 )->get_actions();

view raw
action.php
hosted with ❤ by GitHub

Interacting with the Action Model

<?php
// Get the ID for a Model
$id = $model->get_id();
// Get a single setting for a Model by key
$setting = $model->get_setting( 'key' );
// Get all settings for a model
$settings = $model->get_settings();
// Get extra data stored with a submission.
$more_data = $model->get_extra_value( 'more_data' );
// Update a single setting for a model and save
$model->update_setting( 'key', 'value' )->save();
// Update an array of settings for a mdoel and save
$model->update_settings( $settings )->save();
// Delete a model
$model->delete();
// Save changes to a model
$model->save();