Snippets as JSON object. */ public function generate_export(): array { $snippets = []; foreach ( $this->get_snippets_list() as $snippet ) { $snippets[] = array_map( function ( $value ) { return is_string( $value ) ? str_replace( "\r\n", "\n", $value ) : $value; }, $snippet->get_modified_fields() ); } return [ 'generator' => 'Code Snippets v' . PLUGIN_VERSION, 'date_created' => gmdate( 'Y-m-d H:i' ), 'snippets' => $snippets, ]; } }