Pods::add PHP Метод

add() публичный Метод

You may be looking for save() in most cases where you're setting a specific field.
См. также: PodsAPI::save_pod_item
С версии: 2.0
public add ( array | string $data = null, mixed $value = null ) : integer
$data array | string Either an associative array of field information or a field name
$value mixed (optional) Value of the field, if $data is a field name
Результат integer The item ID
    public function add($data = null, $value = null)
    {
        if (null !== $value) {
            $data = array($data => $value);
        }
        $data = (array) $this->do_hook('add', $data);
        if (empty($data)) {
            return 0;
        }
        $params = array('pod' => $this->pod, 'data' => $data, 'allow_custom_fields' => true);
        return $this->api->save_pod_item($params);
    }