| |
| <?php
|
| <?php
|
|
|
|
|
|
|
|
|
|
|
|
|
| add_action('add_meta_boxes', 'cb_register_podcast_meta_boxes');
|
| function cb_register_podcast_meta_boxes() {
|
| add_meta_box(
|
| 'cb_podcast_advanced_meta',
|
| 'Podcast Episode: Advanced Details (LLM & Citations)',
|
| 'cb_render_podcast_meta_boxes',
|
| 'cb-episode',
|
| 'normal',
|
| 'high'
|
| );
|
| }
|
|
|
| function cb_render_podcast_meta_boxes($post) {
|
|
|
| wp_nonce_field('cb_podcast_meta_nonce_action', 'cb_podcast_meta_nonce');
|
|
|
|
|
| $key_concepts = get_post_meta($post->ID, 'key_concepts', true);
|
| $references = get_post_meta($post->ID, 'referenced_in_episode', true);
|
| $companion = get_post_meta($post->ID, 'companion_post_url', true);
|
|
|
| echo '<style>
|
| .cb-meta-row { margin-bottom: 20px; }
|
| .cb-meta-row label { display: block; font-weight: bold; margin-bottom: 5px; }
|
| .cb-meta-row .description { color: #666; font-size: 12px; margin-bottom: 5px; display: block; }
|
| .cb-meta-row textarea { width: 100%; font-family: monospace; }
|
| .cb-meta-row input[type="url"] { width: 100%; }
|
| </style>';
|
|
|
|
|
| echo '<div class="cb-meta-row">';
|
| echo '<label for="key_concepts">6. Key Concepts Defined</label>';
|
| echo '<span class="description">Format: "Concept — Definition" (one per line). Example: <em>Strategic silence — Deliberate non-response as an institutional posture.</em></span>';
|
| echo '<textarea id="key_concepts" name="key_concepts" rows="5">' . esc_textarea($key_concepts) . '</textarea>';
|
| echo '</div>';
|
|
|
|
|
| echo '<div class="cb-meta-row">';
|
| echo '<label for="referenced_in_episode">7. Referenced in this Episode (Citations)</label>';
|
| echo '<span class="description">The scholarly-citation-graph layer. Paste an HTML bulleted list or just text (it will be formatted automatically).</span>';
|
| echo '<textarea id="referenced_in_episode" name="referenced_in_episode" rows="5">' . esc_textarea($references) . '</textarea>';
|
| echo '</div>';
|
|
|
|
|
| echo '<div class="cb-meta-row">';
|
| echo '<label for="companion_post_url">8. Companion Post Link</label>';
|
| echo '<span class="description">Link to the response brief or written companion post.</span>';
|
| echo '<input type="url" id="companion_post_url" name="companion_post_url" value="' . esc_attr($companion) . '" placeholder="https://..." />';
|
| echo '</div>';
|
| }
|
|
|
| add_action('save_post', 'cb_save_podcast_meta_boxes');
|
| function cb_save_podcast_meta_boxes($post_id) {
|
|
|
| if (!isset($_POST['cb_podcast_meta_nonce']) || !wp_verify_nonce($_POST['cb_podcast_meta_nonce'], 'cb_podcast_meta_nonce_action')) {
|
| return;
|
| }
|
| if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) return;
|
| if (!current_user_can('edit_post', $post_id)) return;
|
|
|
|
|
| if (isset($_POST['key_concepts'])) {
|
| update_post_meta($post_id, 'key_concepts', sanitize_textarea_field($_POST['key_concepts']));
|
| }
|
|
|
|
|
| if (isset($_POST['referenced_in_episode'])) {
|
| update_post_meta($post_id, 'referenced_in_episode', wp_kses_post($_POST['referenced_in_episode']));
|
| }
|
|
|
|
|
| if (isset($_POST['companion_post_url'])) {
|
| update_post_meta($post_id, 'companion_post_url', sanitize_url($_POST['companion_post_url']));
|
| }
|
| }
|
| ?>
|
|
|
| |
| |
Comments