Title: set_current_screen
Published: April 25, 2014
Last modified: February 24, 2026

---

# set_current_screen( string|WP_Screen $hook_name )

## In this article

 * [Parameters](https://developer.wordpress.org/reference/functions/set_current_screen/?output_format=md#parameters)
 * [Source](https://developer.wordpress.org/reference/functions/set_current_screen/?output_format=md#source)
 * [Related](https://developer.wordpress.org/reference/functions/set_current_screen/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/functions/set_current_screen/?output_format=md#changelog)

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

Set the current screen object

## 󠀁[Parameters](https://developer.wordpress.org/reference/functions/set_current_screen/?output_format=md#parameters)󠁿

 `$hook_name`string|[WP_Screen](https://developer.wordpress.org/reference/classes/wp_screen/)
optional

The hook name (also known as the hook suffix) used to determine the screen, or an
existing screen object.

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

    ```php
    function set_current_screen( $hook_name = '' ) {
    	WP_Screen::get( $hook_name )->set_current_screen();
    }
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/screen.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/6.9.4/src/wp-admin/includes/screen.php#L242)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/6.9.4/src/wp-admin/includes/screen.php#L242-L244)

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

| Uses | Description | 
| [WP_Screen::get()](https://developer.wordpress.org/reference/classes/wp_screen/get/)`wp-admin/includes/class-wp-screen.php` |

Fetches a screen object.

  |

| Used by | Description | 
| [wp_ajax_search_install_plugins()](https://developer.wordpress.org/reference/functions/wp_ajax_search_install_plugins/)`wp-admin/includes/ajax-actions.php` |

Handles searching plugins to install via AJAX.

  | 
| [wp_ajax_search_plugins()](https://developer.wordpress.org/reference/functions/wp_ajax_search_plugins/)`wp-admin/includes/ajax-actions.php` |

Handles searching plugins via AJAX.

  | 
| [wp_ajax_dashboard_widgets()](https://developer.wordpress.org/reference/functions/wp_ajax_dashboard_widgets/)`wp-admin/includes/ajax-actions.php` |

Handles dashboard widgets via AJAX.

  |

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

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

## User Contributed Notes

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