| @@ -122,8 +122,22 @@ | ||
| 122 | 122 | <?php |
| 123 | 123 | } |
| 124 | 124 | |
| 125 | 125 | /** |
| 126 | + * Process value before save to DB. | |
| 127 | + * | |
| 128 | + * By default do nothing. inheritors may save meta data or validate the value before saving it to the DB. | |
| 129 | + * | |
| 130 | + * @param mixed $value | |
| 131 | + * @param array $config | |
| 132 | + * | |
| 133 | + * @return mixed | |
| 134 | + */ | |
| 135 | + public function before_save( $value, array $config ) { | |
| 136 | + return $value; | |
| 137 | + } | |
| 138 | + | |
| 139 | + /** | |
| 126 | 140 | * Get default control settings. |
| 127 | 141 | * |
| 128 | 142 | * Retrieve the default settings of the control. Used to return the default |
| 129 | 143 | * settings while initializing the control. |
| @@ -134,23 +148,6 @@ | ||
| 134 | 148 | * @return array Control default settings. |
| 135 | 149 | */ |
| 136 | 150 | protected function get_default_settings() { |
| 137 | 151 | return []; |
| 138 | - } | |
| 139 | - | |
| 140 | - public static function get_assets( $setting ) { | |
| 141 | - return []; | |
| 142 | - } | |
| 143 | - | |
| 144 | - /** | |
| 145 | - * Update value of control that needs to be updated after import. | |
| 146 | - * | |
| 147 | - * @param mixed $value | |
| 148 | - * @param array $control_args | |
| 149 | - * @param array $config | |
| 150 | - * | |
| 151 | - * @return mixed | |
| 152 | - */ | |
| 153 | - public function on_import_update_settings( $value, array $control_args, array $config ) { | |
| 154 | - return $value; | |
| 155 | 152 | } |
| 156 | 153 | } |