<?php
global $current_user, $user_ID , $user_level;
get_currentuserinfo(); //Get the information about the current user.
if (current_user_can('manage_options')): //is admin
echo "<p>Hi Chris</p>n";
$api = new PodAPI();
$Record = new Pod('my_pod');
$Record->findRecords('id ASC', -1);
while ($Record->fetchRecord()) {
//Your action code goes between these
$old_data = $Record->get_field('my_data');
$new_data = $old_data + 1;
//Your action code goes between these
$params = array('datatype' => 'my_pod', 'tbl_row_id' => $Record->get_field('id'), 'columns' => array('my_data' => $new_value));
$params = pods_sanitize($params);
$api->save_pod_item($params);
echo "<p>Changed ". $Record->get_field('name') . ".my_data from " . $old_data ." to " . $Record->get_field('my_data') ."</p>n";
// break; //Remove comment to test with just one row to see how this works.
}
else: ?>
<h2>Sorry</h2>
<p>You don't have the privileges required to use this resource</h2>
<?php endif; ?>