@marvalt/wadapter 2.2.0 → 2.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -2309,11 +2309,12 @@ class WordPressGenerator {
2309
2309
  const frontendId = this.config.frontendId || 'default-frontend';
2310
2310
  const frontendName = this.config.frontendName || 'Default Frontend';
2311
2311
  const postTypes = this.config.postTypes || ['posts', 'pages', 'case_studies', 'projects', 'members', 'testimonial', 'faqs', 'products', 'services', 'events'];
2312
+ // Use 'edit' context only when credentials are provided; otherwise fall back to 'view'
2313
+ const hasBasicAuth = !!(this.config.username && this.config.password);
2312
2314
  const data = await client.getAllData({
2313
2315
  per_page: this.config.maxItems || 100,
2314
2316
  _embed: this.config.includeEmbedded || false,
2315
- // required for content.raw with Gutenberg comments
2316
- context: 'edit',
2317
+ context: hasBasicAuth ? 'edit' : 'view',
2317
2318
  });
2318
2319
  // Create the static data structure matching the existing format
2319
2320
  const staticData = {