Skip to content

Commit 08f723e

Browse files
Update field-data.md (#282)
Typo on the PHP code block. Suppose to be get_type() and get_name(). Co-authored-by: Rami Yushuvaev <[email protected]>
1 parent ae7ba19 commit 08f723e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/form-fields/field-data.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,17 @@ Field data needs to be "returned" by certain methods. These methods are simple:
1111
```php
1212
class Elementor_Test_Field extends \ElementorPro\Modules\Forms\Fields\Field_Base {
1313

14-
public function get_name(): string {
14+
public function get_type() {
1515
return 'field_name';
1616
}
1717

18-
public function get_label(): string {
18+
public function get_name() {
1919
return esc_html__( 'My Field Name', 'textdomain' );
2020
}
2121

2222
}
2323
```
2424

25-
* **Field Type** – The `get_type()` method returns the field name (id) that will be used in the code.
25+
* **Field Type** – The `get_type()` method returns the field id that will be used in the code.
2626

2727
* **Field Name** – The `get_name()` method returns the field label that will be displayed to the user.

0 commit comments

Comments
 (0)