| @@ -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. |
| @@ -93,9 +85,9 @@ | ||
| 93 | 85 | * Add new repeater control to stack. |
| 94 | 86 | * |
| 95 | 87 | * Register a repeater control to allow the user to set/update data. |
| 96 | 88 | * |
| 97 | - * This method should be used inside `register_controls()`. | |
| 89 | + * This method should be used inside `_register_controls()`. | |
| 98 | 90 | * |
| 99 | 91 | * @since 1.0.0 |
| 100 | 92 | * @access public |
| 101 | 93 | * |
| @@ -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 | |