ID, self::META_KEY, true); $meta = is_array($meta) ? $meta : []; $defaults = [ 'title' => '', 'description' => '', 'canonical' => '', 'robots' => '', 'og_title' => '', 'og_description' => '', 'og_image' => '', 'twitter_title' => '', 'twitter_description' => '', 'twitter_image' => '', 'jsonld_mode' => 'auto', 'jsonld_type' => 'Article', 'jsonld_custom' => '', ]; $meta = wp_parse_args($meta, $defaults); // Visual Refinement 1: Get Featured Image for JS Fallback $featured_img = has_post_thumbnail($post) ? get_the_post_thumbnail_url($post, 'full') : ''; echo ''; // Phase 3: Get Value Sources $s_title = Helpers::get_seo_title_with_source($post); $s_desc = Helpers::get_seo_description_with_source($post); $s_canonical = Helpers::get_canonical_url_with_source($post); $s_robots = Helpers::get_robots_with_source($post); $s_og_title = Helpers::get_og_title_with_source($post); $s_og_desc = Helpers::get_og_description_with_source($post); $s_og_image = Helpers::get_og_image_with_source($post); $s_tw_title = Helpers::get_twitter_title_with_source($post); $s_tw_desc = Helpers::get_twitter_description_with_source($post); $s_tw_image = Helpers::get_twitter_image_with_source($post); $og_preview_image = !empty($s_og_image['value']) ? $s_og_image['value'] : ''; $og_preview_title = !empty($s_og_title['value']) ? $s_og_title['value'] : '...'; $og_preview_desc = !empty($s_og_desc['value']) ? $s_og_desc['value'] : '...'; $og_preview_style = ''; if (!empty($og_preview_image)) { $og_preview_style = sprintf('background-image: url(%s);', esc_url($og_preview_image)); } // Helper Closure for Label Rendering $render_label = function ($source_data, $auto_label = null, $inherited_label = null) { $auto_label = $auto_label ?? esc_html__('Auto', 'active-twist-seo-json-ld'); $inherited_label = $inherited_label ?? esc_html__('Inherited', 'active-twist-seo-json-ld'); $src = $source_data['source']; $text = ''; $show_explanation = false; switch ($src) { case Helpers::SOURCE_EXPLICIT: $text = esc_html__('Explicit (set on this page)', 'active-twist-seo-json-ld'); break; case Helpers::SOURCE_AUTO: $text = $auto_label; break; case Helpers::SOURCE_INHERITED: $text = $inherited_label; break; case Helpers::SOURCE_MISSING: $text = esc_html__('Missing', 'active-twist-seo-json-ld'); break; } echo '
' . esc_html__('Source:', 'active-twist-seo-json-ld') . ' ' . esc_html($text) . '
'; }; // Helper for Global Inheritance Explanation $render_explanation = function ($source_data) { if ($source_data['source'] === Helpers::SOURCE_INHERITED) { echo '
' . esc_html__('This value is coming from Active Twist SEO → Settings. You can override it here if needed.', 'active-twist-seo-json-ld') . '
'; } }; ?>

› ...
...
...



style="">


...
...






isset($raw['title']) ? sanitize_text_field($raw['title']) : '', 'description' => isset($raw['description']) ? sanitize_textarea_field($raw['description']) : '', 'canonical' => isset($raw['canonical']) ? esc_url_raw($raw['canonical']) : '', 'robots' => isset($raw['robots']) ? sanitize_text_field($raw['robots']) : '', 'og_title' => isset($raw['og_title']) ? sanitize_text_field($raw['og_title']) : '', 'og_description' => isset($raw['og_description']) ? sanitize_textarea_field($raw['og_description']) : '', 'og_image' => isset($raw['og_image']) ? esc_url_raw($raw['og_image']) : '', 'twitter_title' => isset($raw['twitter_title']) ? sanitize_text_field($raw['twitter_title']) : '', 'twitter_description' => isset($raw['twitter_description']) ? sanitize_textarea_field($raw['twitter_description']) : '', 'twitter_image' => isset($raw['twitter_image']) ? esc_url_raw($raw['twitter_image']) : '', 'jsonld_mode' => isset($raw['jsonld_mode']) ? sanitize_text_field($raw['jsonld_mode']) : 'auto', 'jsonld_type' => isset($raw['jsonld_type']) ? sanitize_text_field($raw['jsonld_type']) : 'Article', 'jsonld_custom' => isset($raw['jsonld_custom']) ? wp_kses_post($raw['jsonld_custom']) : '', ]; update_post_meta($post_id, self::META_KEY, $meta); } }