Skip to content

Instantly share code, notes, and snippets.

@kjohnson
Last active October 27, 2020 12:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kjohnson/7193ff80e3968bb740c0 to your computer and use it in GitHub Desktop.
Save kjohnson/7193ff80e3968bb740c0 to your computer and use it in GitHub Desktop.
<?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();
@dkomando
Copy link

You have a small misspelling on one of your descriptions.
Line 18:
// Update an array of settings for a mdoel and save

// Update an array of settings for a model and save

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