# give/4.16.9/src/Framework/FieldsAPI/Concerns/HasDefaultValue.php

GiveWP – Donation Plugin and Fundraising Platform, version 4.16.9. 39 lines.

- Page: https://pluginprobe.com/plugins/give/4.16.9/code/src/Framework/FieldsAPI/Concerns/HasDefaultValue.php
- Raw: https://pluginprobe.com/plugins/give/4.16.9/raw/src/Framework/FieldsAPI/Concerns/HasDefaultValue.php
- Modified: 2021-11-23T23:55:18+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/give/4.16.9/code/src/Framework/FieldsAPI/Concerns/HasDefaultValue.php#L10-L20`.

```php
<?php

namespace Give\Framework\FieldsAPI\Concerns;

trait HasDefaultValue
{

    /** @var string */
    protected $defaultValue;

    /**
     * @param string|array $defaultValue
     *
     * @return $this
     */
    public function defaultValue($defaultValue)
    {
        $this->defaultValue = $defaultValue;

        return $this;
    }

    /**
     * @return string|array
     */
    public function getDefaultValue()
    {
        return $this->defaultValue;
    }

    /**
     * @return string|array
     */
    public function getSelected()
    {
        return $this->getDefaultValue();
    }
}

```
