Carbon_Fields\Field\Field::get_value PHP Method

get_value() public method

Return the field value
public get_value ( ) : mixed
return mixed
    public function get_value()
    {
        return $this->value;
    }

Usage Example

 /**
  * Save the field value(s) into the database.
  *
  * @param Field $field The field to save.
  */
 public function save(Field $field)
 {
     $name = $field->get_name();
     $autoload = $field->get_autoload() ? 'yes' : 'no';
     // Add value to the cache, so that add_option always works
     $notoptions = wp_cache_get('notoptions', 'options');
     $notoptions[$name] = '';
     wp_cache_set('notoptions', $notoptions, 'options');
     if (!add_option($name, $field->get_value(), null, $autoload)) {
         update_option($name, $field->get_value());
     }
 }
All Usage Examples Of Carbon_Fields\Field\Field::get_value