get_all_registered() as $name => $block) { if (!str_starts_with($name, 'filter-query-block-pro/')) continue; $handles = array_merge($block->editor_script_handles, $block->script_handles, $block->view_script_handles); foreach (array_unique($handles) as $handle) { $script = wp_scripts()->registered[$handle] ?? null; if ($script && in_array('wp-i18n', $script->deps, true)) wp_set_script_translations($handle, FQBPRO_TEXT_DOMAIN, $path); } } } /** * Show build notice when files are missing */ function show_build_notice() { printf( '

%s

', sprintf( /* translators: 1: Plugin name, 2: Dependency installation command, 3: Asset build command, 4: Asset watch command. */ esc_html__('%1$s requires files to be built. Run %2$s to install dependencies, %3$s to build the files or %4$s to build the files and watch for changes.', 'accomplice-query-loop-filters'), '' . esc_html(FQBPRO_PLUGIN_NAME) . '', 'pnpm install', 'pnpm run build', 'pnpm start' ) ); }