# yatra/3.0.8/resources/js/lib/wp-media-open.ts

Yatra – Travel Booking &amp; Tour Operator Software, version 3.0.8. 12 lines.

- Page: https://pluginprobe.com/plugins/yatra/3.0.8/code/resources/js/lib/wp-media-open.ts
- Raw: https://pluginprobe.com/plugins/yatra/3.0.8/raw/resources/js/lib/wp-media-open.ts
- Modified: 2026-04-14T03:47:24+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/yatra/3.0.8/code/resources/js/lib/wp-media-open.ts#L10-L20`.

```typescript
/**
 * Prepare the DOM before opening wp.media() so the modal is visible and focus/ARIA stay valid.
 * WordPress may set aria-hidden on #wpwrap while the trigger button still has focus.
 */
export function prepareWordPressMediaFrameOpen(): void {
  const active = document.activeElement;
  if (active instanceof HTMLElement) {
    active.blur();
  }
  document.getElementById("wpwrap")?.removeAttribute("aria-hidden");
}

```
