Apple_Exporter\Workspace::write_json PHP Метод

write_json() публичный Метод

Stores the JSON file for this workspace to be included in the bundle.
С версии: 0.9.0
public write_json ( string $content )
$content string
    public function write_json($content)
    {
        $json = apply_filters('apple_news_write_json', $content, $this->content_id);
        // JSON should be decoded before being stored.
        // Otherwise, stripslashes_deep could potentially remove valid characters
        // such as newlines (\n).s
        $decoded_json = json_decode(sanitize_text_field($json));
        if (null === $decoded_json) {
            // This is invalid JSON.
            // Store as an empty string.
            $decoded_json = '';
        }
        update_post_meta($this->content_id, self::JSON_META_KEY, $decoded_json);
    }