fix: content-create with divi returns the Visual Builder edit_url (review I-1)
DiviPage::builderUrl() is shared by DiviPage::editUrl() and the content composer, which now returns edit_url; content-create without divi keeps the wp-admin link. divi-write-smoke checks the builder URL and, new in section 9, the M1/M2 gates live (raw Divi markup refused; Divi read-only stops content-create divi and execute-ability lit/divi-insert). Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01At3V6SjwbMe6eMzVGW3Hs7
This commit is contained in:
@@ -90,7 +90,11 @@ final class DiviContentComposer implements ContentComposer
|
||||
|
||||
$saved = $this->saver->saveNew($postId, Serializer::document($layout['document']));
|
||||
|
||||
return ['warnings' => array_merge($warnings, $saved), 'outline' => (string) $outline['text']];
|
||||
return [
|
||||
'warnings' => array_merge($warnings, $saved),
|
||||
'outline' => (string) $outline['text'],
|
||||
'edit_url' => DiviPage::builderUrl($postId),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -38,6 +38,12 @@ final class DiviPage
|
||||
|
||||
public function editUrl(): string
|
||||
{
|
||||
return (string) add_query_arg('et_fb', '1', (string) get_permalink($this->post));
|
||||
return self::builderUrl($this->post);
|
||||
}
|
||||
|
||||
/** The entry opened in the Divi Visual Builder – the edit_url of every Divi write (review I-1). */
|
||||
public static function builderUrl(WP_Post|int $post): string
|
||||
{
|
||||
return (string) add_query_arg('et_fb', '1', (string) get_permalink($post));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user