Skip to content

Commit

Permalink
Update field-data.md (#282)
Browse files Browse the repository at this point in the history
Typo on the PHP code block. Suppose to be get_type() and get_name().

Co-authored-by: Rami Yushuvaev <[email protected]>
  • Loading branch information
caleb-bright and rami-elementor authored Dec 23, 2024
1 parent ae7ba19 commit 08f723e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/form-fields/field-data.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,17 @@ Field data needs to be "returned" by certain methods. These methods are simple:
```php
class Elementor_Test_Field extends \ElementorPro\Modules\Forms\Fields\Field_Base {

public function get_name(): string {
public function get_type() {
return 'field_name';
}

public function get_label(): string {
public function get_name() {
return esc_html__( 'My Field Name', 'textdomain' );
}

}
```

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

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

0 comments on commit 08f723e

Please sign in to comment.