base-source.php
4 years ago
preset-source-post.php
4 years ago
preset-source-query-var.php
4 years ago
preset-source-user.php
4 years ago
preset-source-query-var.php
24 lines
| 1 | <?php |
| 2 | |
| 3 | |
| 4 | namespace Jet_Form_Builder\Presets\Sources; |
| 5 | |
| 6 | |
| 7 | class Preset_Source_Query_Var extends Base_Source { |
| 8 | |
| 9 | public function get_id() { |
| 10 | return 'query_var'; |
| 11 | } |
| 12 | |
| 13 | public function query_source() { |
| 14 | return $_GET; |
| 15 | } |
| 16 | |
| 17 | public function get_prop() { |
| 18 | return ! empty( $this->field_data['other']['query_var'] ) ? $this->field_data['other']['query_var'] : self::EMPTY; |
| 19 | } |
| 20 | |
| 21 | public function get_result_on_prop() { |
| 22 | return isset( $this->src()[ $this->prop ] ) ? $this->src()[ $this->prop ] : null; |
| 23 | } |
| 24 | } |