Title: wp_get_view_transitions_admin_css
Published: May 20, 2026
Last modified: August 20, 2026

---

# wp_get_view_transitions_admin_css(): string

## In this article

 * [Return](https://developer.wordpress.org/reference/functions/wp_get_view_transitions_admin_css/?output_format=md#return)
 * [Source](https://developer.wordpress.org/reference/functions/wp_get_view_transitions_admin_css/?output_format=md#source)
 * [Related](https://developer.wordpress.org/reference/functions/wp_get_view_transitions_admin_css/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/functions/wp_get_view_transitions_admin_css/?output_format=md#changelog)
 * [User Contributed Notes](https://developer.wordpress.org/reference/functions/wp_get_view_transitions_admin_css/?output_format=md#user-contributed-notes)

[ Back to top](https://developer.wordpress.org/reference/functions/wp_get_view_transitions_admin_css/?output_format=md#wp--skip-link--target)

Gets the CSS for View Transitions in the admin.

## 󠀁[Return](https://developer.wordpress.org/reference/functions/wp_get_view_transitions_admin_css/?output_format=md#return)󠁿

 string The CSS.

## 󠀁[Source](https://developer.wordpress.org/reference/functions/wp_get_view_transitions_admin_css/?output_format=md#source)󠁿

    ```php
    function wp_get_view_transitions_admin_css(): string {
    	$affix = SCRIPT_DEBUG ? '' : '.min';
    	$path  = ABSPATH . "wp-admin/css/view-transitions{$affix}.css";
    	return file_get_contents( $path );
    }
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-includes/view-transitions.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/7.1/src/wp-includes/view-transitions.php#L26)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-includes/view-transitions.php#L26-L30)

## 󠀁[Related](https://developer.wordpress.org/reference/functions/wp_get_view_transitions_admin_css/?output_format=md#related)󠁿

| Used by | Description | 
| [wp_default_styles()](https://developer.wordpress.org/reference/functions/wp_default_styles/)`wp-includes/script-loader.php` |

Assigns default styles to $styles object.

  |

## 󠀁[Changelog](https://developer.wordpress.org/reference/functions/wp_get_view_transitions_admin_css/?output_format=md#changelog)󠁿

| Version | Description | 
| [7.0.0](https://developer.wordpress.org/reference/since/7.0.0/) | Introduced. |

## 󠀁[User Contributed Notes](https://developer.wordpress.org/reference/functions/wp_get_view_transitions_admin_css/?output_format=md#user-contributed-notes)󠁿

 1.  [Skip to note 2 content](https://developer.wordpress.org/reference/functions/wp_get_view_transitions_admin_css/?output_format=md#comment-content-7583)
 2.   [Rodrigo Vieira Eufrasio da Silva](https://profiles.wordpress.org/rodrigomct/)
    [  2 months ago  ](https://developer.wordpress.org/reference/functions/wp_get_view_transitions_admin_css/#comment-7583)
 3. [You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fwp_get_view_transitions_admin_css%2F%23comment-7583)
    Vote results for this note: 0[You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fwp_get_view_transitions_admin_css%2F%23comment-7583)
 4. This function reads the raw CSS file content and returns it as a string, rather
    than returning a URL. This is because the view-transitions CSS ends up being registered
    as inline CSS (added directly inside a tag in wp-admin), not as a separate stylesheet
    file loaded via .
 5. You can see this in practice: [wp_default_styles()](https://developer.wordpress.org/reference/functions/wp_default_styles/)
    calls this function and passes the returned string to $styles->add_data(), using
    the ‘after’ key, so the CSS is printed inline right after the ‘wp-view-transitions-
    admin’ handle is enqueued.
 6. Also note that the CSS file used depends on SCRIPT_DEBUG: if it’s true, the unminified‘
    view-transitions.css’ is read; otherwise, the minified ‘view-transitions.min.css’
    is used, following the same convention as other core styles/scripts.
 7.  [Log in to add feedback](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fwp_get_view_transitions_admin_css%2F%3Freplytocom%3D7583%23feedback-editor-7583)

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fwp_get_view_transitions_admin_css%2F)
before being able to contribute a note or feedback.