feat: Implement WordPress publishing and unpublishing actions
- Added conditional visibility for table actions based on content state (published/draft). - Introduced `publishContent` and `unpublishContent` API functions for handling WordPress integration. - Updated `Content` component to manage publish/unpublish actions with appropriate error handling and success notifications. - Refactored `PostEditor` to remove deprecated SEO fields and consolidate taxonomy management. - Enhanced `TablePageTemplate` to filter row actions based on visibility conditions. - Updated backend API to support publishing and unpublishing content with proper status updates and external references.
This commit is contained in:
@@ -56,12 +56,12 @@ class WordPressAdapter(BaseAdapter):
|
||||
if hasattr(content, 'title'):
|
||||
# Content model instance
|
||||
title = content.title
|
||||
# Try different possible attribute names for content
|
||||
content_html = getattr(content, 'html_content', None) or getattr(content, 'content', None) or ''
|
||||
# Stage 1 schema: content_html is the primary field
|
||||
content_html = getattr(content, 'content_html', '') or getattr(content, 'html_content', '') or getattr(content, 'content', '')
|
||||
elif isinstance(content, dict):
|
||||
# Dict with content data
|
||||
title = content.get('title', '')
|
||||
content_html = content.get('html_content') or content.get('content', '')
|
||||
content_html = content.get('content_html') or content.get('html_content') or content.get('content', '')
|
||||
else:
|
||||
raise ValueError(f"Unsupported content type: {type(content)}")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user