context['postId'] ?? get_the_ID(); $host_post_id = $host_post_id ? absint( $host_post_id ) : 0; $rendered = GenerateBlocks_Pro_Form_Render::render( $form_id, 'public', [ 'host_post_id' => $host_post_id ] ); if ( is_wp_error( $rendered ) ) { // Public render failure — emit nothing rather than leaking error // detail. Admin users see a placeholder hint to help debugging. if ( current_user_can( GenerateBlocks_Pro_Form_Post_Type::get_capability( 'manage' ) ) ) { return sprintf( '
%s
', esc_html__( 'Form not available. Make sure the referenced form is published.', 'generateblocks-pro' ) ); } return ''; } GenerateBlocks_Pro_Form_Render::enqueue_public_assets(); return $rendered; } /** * Enqueue block assets. */ public static function enqueue_assets() { GenerateBlocks_Pro_Form_Render::enqueue_public_assets(); } }