PluginProbe
Elementor Website Builder – more than just a page builder / 3.4.3
Elementor Website Builder – more than just a page builder v3.4.3
4.3.0-beta2 4.3.0-beta1 4.2.4 4.2.3 4.2.2 4.2.1 4.2.0 4.1.5 4.2.0-beta2 4.2.0-dev2 4.2.0-beta1 4.1.4 4.1.3 4.1.2 4.1.1 4.1.0 4.1.0-beta3 4.1.0-dev3 4.0.9 4.1.0-beta2 4.1.0-dev2 4.0.8 4.1.0-beta1 4.1.0-dev1 4.0.7 All 451 releases
← All changes | includes/elements/repeater.php +6 -14 4.1.23.4.3 View file →
@@ -27,15 +27,8 @@
27 27 */
28 28 private static $counter = 0;
29 29
30 30 /**
31 - * Holds the count of the CURRENT instance
32 - *
33 - * @var int
34 - */
35 - private $id;
36 -
37 - /**
38 31 * Repeater constructor.
39 32 *
40 33 * Initializing Elementor repeater element.
41 34 *
@@ -43,14 +36,13 @@
43 36 * @access public
44 37 *
45 38 * @param array $data Optional. Element data. Default is an empty array.
46 39 * @param array|null $args Optional. Element default arguments. Default is null.
40 + *
47 41 */
48 - public function __construct( array $data = [], ?array $args = null ) {
49 - ++self::$counter;
42 + public function __construct( array $data = [], array $args = null ) {
43 + self::$counter++;
50 44
51 - $this->id = self::$counter;
52 -
53 45 parent::__construct( $data, $args );
54 46
55 47 $this->add_control(
56 48 '_id',
@@ -70,9 +62,9 @@
70 62 *
71 63 * @return string Repeater name.
72 64 */
73 65 public function get_name() {
74 - return 'repeater-' . $this->id;
66 + return 'repeater-' . self::$counter;
75 67 }
76 68
77 69 /**
78 70 * Get repeater type.
@@ -121,15 +113,15 @@
121 113 *
122 114 * Retrieve the fields from the current repeater control.
123 115 *
124 116 * @since 1.5.0
125 - * @deprecated 2.1.0 Use `get_controls()` method instead.
117 + * @deprecated 2.1.0 Use `Repeater::get_controls()` instead.
126 118 * @access public
127 119 *
128 120 * @return array Repeater fields.
129 121 */
130 122 public function get_fields() {
131 - _deprecated_function( __METHOD__, '2.1.0', 'get_controls()' );
123 + _deprecated_function( __METHOD__, '2.1.0', __CLASS__ . '::get_controls()' );
132 124
133 125 return array_values( $this->get_controls() );
134 126 }
135 127