Skip to content

Commit e0ac9dd

Browse files
committed
REFACTOR: Remove getType() override to allow extensibility
Remove the getType() method override so the element inherits BaseElement::getType() which uses i18n_singular_name(). This allows sites to customize the element's display name via extensions by setting $singular_name. Also updated $singular_name from 'Embedded Code Element' to 'Embedded Code' and $plural_name to 'Embedded Code Blocks' for better consistency with other elements. Fixes #19
1 parent 332f252 commit e0ac9dd

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

src/Elements/ElementEmbeddedCode.php

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@ class ElementEmbeddedCode extends BaseElement
2020
/**
2121
* @var string
2222
*/
23-
private static $singular_name = 'Embedded Code Element';
23+
private static $singular_name = 'Embedded Code';
2424

2525
/**
2626
* @var string
2727
*/
28-
private static $plural_name = 'Embedded Code Elements';
28+
private static $plural_name = 'Embedded Code Blocks';
2929

3030
private static $description = 'Embed code like iFrames or Javascript on a page.';
3131

@@ -57,14 +57,6 @@ public function getCMSFields()
5757
return $fields;
5858
}
5959

60-
/**
61-
* @return string
62-
*/
63-
public function getType()
64-
{
65-
return _t(__CLASS__.'.BlockType', 'Embedded Code');
66-
}
67-
6860
/**
6961
* @return DBHTMLText
7062
*/

0 commit comments

Comments
 (0)