LLMS_Form_Field::__construct( array $settings = array(), int|object $data_source = null )
Constructor
Parameters Parameters
- $settings
-
(array) (Optional) Field settings.
Default value: array()
- $data_source
-
(int|object) (Optional) Data source where to get field value from. Default is
null. Can be a WP_User or a WP_Post, or their id. The actual object will be retrieved basing on the data_store.Default value: null
Return Return
(void)
Source Source
File: includes/forms/class-llms-form-field.php
public function __construct( $settings = array(), $data_source = null ) {
/**
* Filters the settings of a LifterLMS Form Field
*
* @since 5.0.0
*
* @param array $settings Field settings.
* @param LLMS_Form_Field $field Form field class instance.
*/
$this->settings = apply_filters( 'llms_field_settings', wp_parse_args( $settings, $this->get_defaults() ), $this );
$this->define_data_source( $data_source );
$this->prepare();
}
Expand full source code Collapse full source code View on GitHub
Changelog Changelog
| Version | Description |
|---|---|
| 5.0.0 | Introduced. |