set_field
(Since 1.2.0) -- change a variable within the Pod class
function set_field($name, $data)
This function changes a column value within the Pod class. After being set, you can access it via get_field.
NOTE: this method does NOT make any database changes. To make changes in the DB, using the PodAPI save_pod_item method.
Parameters
| Parameter | Type | Details |
|---|---|---|
| $name | STRING | the column name |
| $data | STRING | the value to assign |
Examples
<?php
$pods->set_field('amount', 500);
?>
The above code works identically to $pods->data['amount'] = 500;