` markup.
*/
function openstation_code_blue_icon_svg() {
return ''
. ' '
. ' '
. ' ';
}
/**
* Render the Code Blue window's static template body. The bundle
* mounts its UI into `[data-os-code-blue-root]`.
*/
function openstation_code_blue_render_template() {
ob_start();
?>
__( 'Code Blue', 'desktop-mode' ),
'icon' => $icon_uri,
'template' => 'openstation_code_blue_render_template',
'script' => 'openstation-code-blue',
'styles' => array( 'openstation-code-blue' ),
'width' => 1060,
'height' => 700,
'min_width' => 720,
'min_height' => 480,
'placement' => 'none',
'config' => array(
'restNonce' => wp_create_nonce( 'wp_rest' ),
'apiBase' => esc_url_raw( rest_url( 'desktop-mode/v1/code-blue' ) ),
),
);
/**
* Filter the args used to register the Code Blue native window.
*
* @param array $window_args Args passed to `openstation_register_window()`.
*/
$window_args = (array) apply_filters( 'openstation_code_blue_window_args', $window_args );
$registered = openstation_register_window( 'openstation-code-blue', $window_args );
if ( is_wp_error( $registered ) ) {
// phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_error_log
error_log( '[openstation] Code Blue window registration failed: ' . $registered->get_error_message() );
return;
}
$icon_args = array(
'title' => __( 'Code Blue', 'desktop-mode' ),
'icon_svg' => openstation_code_blue_icon_svg(),
'window' => 'openstation-code-blue',
'pinned' => false,
'position' => 24,
);
/**
* Filter the args used to register the Code Blue desktop icon.
*
* @param array $icon_args Args passed to `openstation_register_icon()`.
*/
$icon_args = (array) apply_filters( 'openstation_code_blue_icon_args', $icon_args );
openstation_register_icon( 'openstation-code-blue', $icon_args );
}
add_action( 'init', 'openstation_code_blue_register_window', 20 );