<?php
/**
 * File Path: includes/metaboxes/book-header/class-mbs-book-header-core.php
 *
 * Book Header Child Section - Core Fields
 *
 * Handles simple core fields: Book Title, Publisher, Teaser, Synopsis,
 * Series Position, Language.
 *
 * Note: Page Count and Edition have been moved to format rows (Sprint — Step 2).
 * They live in mbs_format_rows and are no longer stored as book-level postmeta.
 *
 * @package    My_Book_Showroom
 * @subpackage Includes/Metaboxes/BookHeader
 * @since      1.0.0
 */

if ( ! defined( 'ABSPATH' ) ) {
    exit;
}

/**
 * Class MBS_Book_Header_Core
 */
class MBS_Book_Header_Core { // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedClassFound -- mbs_/MBS_ prefix is correct; scanner not configured with plugin prefix

    public function __construct() {
        add_action( 'mbs_book_header_render_core', array( 'MBS_Book_Header_Core_Render', 'render' ) );
        add_action( 'mbs_book_header_save_core',   array( 'MBS_Book_Header_Core_Save',   'save' ),   10, 2 );
        // PLG-055: Display admin error if multiple series terms were somehow submitted.
        add_action( 'admin_notices',               array( 'MBS_Book_Header_Core_Render', 'maybe_show_series_error' ) );
        // D-5: sync_title_to_post is registered in MBS_Plugin::load_admin() so it fires
        // before wp_insert_post_data (which precedes save_post). Registering it here as
        // well would cause a double-call on page-render requests.
    }
}
