public function update()
{
if (!$this->is_build_with_elementor()) {
return;
}
$this->parse_elements_css();
$meta = ['version' => ELEMENTOR_VERSION, 'time' => time(), 'fonts' => array_unique($this->fonts)];
if (empty($this->css)) {
$this->delete();
$meta['status'] = self::CSS_STATUS_EMPTY;
$meta['css'] = '';
} else {
$file_created = false;
if (wp_is_writable(dirname($this->path))) {
$file_created = file_put_contents($this->path, $this->css);
}
if ($file_created) {
$meta['status'] = self::CSS_STATUS_FILE;
} else {
$meta['status'] = self::CSS_STATUS_INLINE;
$meta['css'] = $this->css;
}
}
$this->update_meta($meta);
}