403 ] ); } // Nonce verified in is_allowed() above. $form_id = self::sanitize_form_id( isset( $_GET['id'] ) ? sanitize_text_field( wp_unslash( $_GET['id'] ) ) : '' ); // phpcs:ignore WordPress.Security.NonceVerification.Recommended if ( '' === $form_id ) { wp_die( esc_html__( 'Invalid form.', 'epicforms' ), '', [ 'response' => 400 ] ); } // The public bundle is an ES module: enqueueing the classic handle alone // only pulls in its dependency stubs, leaving the form container empty. Epicformbuilder_Vite::enqueue( 'epicforms-public-client', 'epicforms-public-css', 'src/public/index.jsx' ); status_header( 200 ); nocache_headers(); // Use theme header/footer for realism. get_header(); echo '
'; // Render directly rather than building a shortcode string from input. echo ( new Epicformbuilder_Public() )->epicforms_shortcode( [ 'id' => $form_id ] ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- shortcode output is built and escaped by the renderer. echo '
'; get_footer(); exit; } }