'on', '_et_pb_use_builder' => 'on', '_et_pb_show_page_creation' => 'off', ]; public static function manifest(): Manifest { return new Manifest( Manifest::PAGES, calls: [ new Call('ET_Core_PageResource::remove_static_resources', 3), new Call('et_builder_get_public_post_types', 0), ], keys: ['_et_pb_use_divi_5', '_et_pb_use_builder', '_et_pb_show_page_creation', 'et_fb'], mirrors: [ new Mirror( 'vb-sync-flags', 'includes/builder-5/server/VisualBuilder/REST/SyncToServer/SyncToServerController.php', 'update', 'SyncToServerController', 'Builder-Kennzeichen einer Seite (_et_pb_use_divi_5, _et_pb_use_builder, _et_pb_show_page_creation)' ), ] ); } /** * @throws RuntimeException When a flag does not read back as set. * @throws DiviLocked When Divi is not released (spec §5.5) – before anything is written. */ public static function setFlags(int $postId): void { ReleaseGate::assertWritable($postId); foreach (self::FLAGS as $key => $value) { update_post_meta($postId, $key, $value); } foreach (self::FLAGS as $key => $value) { if (get_post_meta($postId, $key, true) !== $value) { throw new RuntimeException(sprintf('Divi flag %s of post %d is not "%s".', $key, $postId, $value)); } } } /** Whether Divi's builder flag marks $postId as a builder layout. */ public static function usesBuilder(int $postId): bool { return get_post_meta($postId, '_et_pb_use_builder', true) === 'on'; } /** The entry opened in the Divi Visual Builder: its permalink with et_fb=1. */ public static function builderUrl(WP_Post|int $post): string { return (string) add_query_arg('et_fb', '1', (string) get_permalink($post)); } /** Removes the static CSS files Divi generated for $postId (spec §5.6 step 5). */ public static function clearPageCss(int $postId): void { if (class_exists('ET_Core_PageResource')) { \ET_Core_PageResource::remove_static_resources($postId, 'all', true); } } /** Whether Divi offers a post_link_url_ option for $postType. Fail closed: without Divi's list, none. */ public static function isLinkable(string $postType): bool { if (! function_exists('et_builder_get_public_post_types')) { return false; } $types = et_builder_get_public_post_types(); return is_array($types) && array_key_exists($postType, $types); } }