<?php
/**
 * Entity Blocks Section for Page Editor
 * Delegates to shared entity blocks template with page-specific variables
 */

// Get the page ID for entity blocks lookup
// Use the live page ID (not sandbox/draft ID) to match how blocks are stored
$entity_page_id = $post['id'] ?? 0;

// If this is a sandbox/draft page, use the live page ID instead
if (!empty($post['draft_for_page_id']) && $post['draft_for_page_id'] > 0) {
    $entity_page_id = $post['draft_for_page_id'];
}

$entity_type = 'page';
$entity_id = $entity_page_id;

require __DIR__ . '/../../templates/entity_blocks.php';
