ID, '_addifect_post_blocks', true ); // Clean the slashes we added during save (wp_slash) and ensure it's an array. $addifect_clean_blocks = is_array( $addifect_blocks_array ) ? stripslashes_deep( $addifect_blocks_array ) : array(); $addifect_featured_image = ''; $addifect_get_img = get_the_post_thumbnail_url( $post->ID, 'large' ); if ( $addifect_get_img ) { $addifect_featured_image = $addifect_get_img; } // Attach the exact structure the React engine expects for data binding. $addifect_blocks_output['activePost'] = array( 'meta' => array( 'id' => $post->ID, 'title' => $post->post_title, 'slug' => $post->post_name, 'date' => get_the_date( '', $post ), 'featuredImage' => $addifect_featured_image, ), 'content' => $addifect_clean_blocks, ); } // ============================================================================ // 2. THE INJECTION: Run the Master SSR Engine // ============================================================================ // Pass both the compiled HTML and the prepared JSON into the Hydrator $addifect_ssr_processed = Addifect_SSR_Engine::process_page( $addifect_inner_content, $addifect_blocks_output ); // Extract the hydrated outputs. $addifect_final_html = $addifect_ssr_processed['html']; $addifect_final_json = $addifect_ssr_processed['json']; // THE INJECTION: Hydrate the SSR string with real WordPress data. $addifect_final_html = addifect_hydrate_ssr_html( $addifect_final_html ); ?> data-color-mode=""> > ' . wp_kses( $addifect_final_html, $addifect_allowed_tags ) . ''; ?>