LLMS_Abstract_Processor::get_data( string $key = null, string $default = '' )
Retrieve data for the current processor that can be used in future processes
Parameters Parameters
- $key
-
(string) (Optional) If set, return a specific piece of data rather than the whole array.
Default value: null
- $default
-
(string) (Optional) When returning a specific piece of data, allows a default value to be passed.
Default value: ''
Return Return
(array|mixed)
Source Source
File: includes/abstracts/llms.abstract.processor.php
public function get_data( $key = null, $default = '' ) {
// Get the array of processor data.
$all_data = get_option( 'llms_processor_data', array() );
// Get data for current processor.
$data = isset( $all_data[ $this->id ] ) ? $all_data[ $this->id ] : array();
// Get a specific piece of data.
if ( $key ) {
return isset( $data[ $key ] ) ? $data[ $key ] : $default;
}
// Return all the data.
return $data;
}
Expand full source code Collapse full source code View on GitHub
Changelog Changelog
| Version | Description |
|---|---|
| 3.15.0 | Introduced. |