[ Index ]

PHP Cross Reference of WordPress

title

Body

[close]

/wp-admin/includes/ -> class-wp-screen.php (summary)

Screen API: WP_Screen class

File Size: 1355 lines (37 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 33 functions

  get()
  set_current_screen()
  __construct()
  in_admin()
  is_block_editor()
  add_old_compat_help()
  set_parentage()
  add_option()
  remove_option()
  remove_options()
  get_options()
  get_option()
  get_help_tabs()
  get_help_tab()
  add_help_tab()
  remove_help_tab()
  remove_help_tabs()
  get_help_sidebar()
  set_help_sidebar()
  get_columns()
  get_screen_reader_content()
  get_screen_reader_text()
  set_screen_reader_content()
  remove_screen_reader_content()
  render_screen_meta()
  show_screen_options()
  render_screen_options()
  render_meta_boxes_preferences()
  render_list_table_columns_preferences()
  render_screen_layout()
  render_per_page_options()
  render_view_mode()
  render_screen_reader_content()

Functions
Functions that are not part of a class:

get( $hook_name = '' )   X-Ref
Fetches a screen object.

return: WP_Screen Screen object.
param: string|WP_Screen $hook_name Optional. The hook name (also known as the hook suffix) used to determine the screen.
since: 3.3.0

set_current_screen()   X-Ref
Makes the screen object the current screen.

since: 3.3.0

__construct()   X-Ref
Constructor

since: 3.3.0

in_admin( $admin = null )   X-Ref
Indicates whether the screen is in a particular admin

return: bool True if the screen is in the indicated admin, false otherwise.
param: string $admin The admin to check against (network | user | site).
since: 3.5.0

is_block_editor( $set = null )   X-Ref
Sets or returns whether the block editor is loading on the current screen.

return: bool True if the block editor is being loaded, false otherwise.
param: bool $set Optional. Sets whether the block editor is loading on the current screen or not.
since: 5.0.0

add_old_compat_help( $screen, $help )   X-Ref
Sets the old string-based contextual help for the screen for backward compatibility.

param: WP_Screen $screen A screen object.
param: string    $help   Help text.
since: 3.3.0

set_parentage( $parent_file )   X-Ref
Set the parent information for the screen.

This is called in admin-header.php after the menu parent for the screen has been determined.

param: string $parent_file The parent file of the screen. Typically the $parent_file global.
since: 3.3.0

add_option( $option, $args = array()   X-Ref
Adds an option for the screen.

Call this in template files after admin.php is loaded and before admin-header.php is loaded
to add screen options.

param: string $option Option ID.
param: mixed  $args   Option-dependent arguments.
since: 3.3.0

remove_option( $option )   X-Ref
Remove an option from the screen.

param: string $option Option ID.
since: 3.8.0

remove_options()   X-Ref
Remove all options from the screen.

since: 3.8.0

get_options()   X-Ref
Get the options registered for the screen.

return: array Options with arguments.
since: 3.8.0

get_option( $option, $key = false )   X-Ref
Gets the arguments for an option for the screen.

return: string The option value if set, null otherwise.
param: string       $option Option name.
param: string|false $key    Optional. Specific array key for when the option is an array.
since: 3.3.0

get_help_tabs()   X-Ref
Gets the help tabs registered for the screen.

return: array Help tabs with arguments.
since: 3.4.0
since: 4.4.0 Help tabs are ordered by their priority.

get_help_tab( $id )   X-Ref
Gets the arguments for a help tab.

return: array Help tab arguments.
param: string $id Help Tab ID.
since: 3.4.0

add_help_tab( $args )   X-Ref
Add a help tab to the contextual help for the screen.

Call this on the `load-$pagenow` hook for the relevant screen,
or fetch the `$current_screen` object, or use get_current_screen()
and then call the method from the object.

You may need to filter `$current_screen` using an if or switch statement
to prevent new help tabs from being added to ALL admin screens.

param: array $args {
since: 3.3.0
since: 4.4.0 The `$priority` argument was added.

remove_help_tab( $id )   X-Ref
Removes a help tab from the contextual help for the screen.

param: string $id The help tab ID.
since: 3.3.0

remove_help_tabs()   X-Ref
Removes all help tabs from the contextual help for the screen.

since: 3.3.0

get_help_sidebar()   X-Ref
Gets the content from a contextual help sidebar.

return: string Contents of the help sidebar.
since: 3.4.0

set_help_sidebar( $content )   X-Ref
Add a sidebar to the contextual help for the screen.

Call this in template files after admin.php is loaded and before admin-header.php is loaded
to add a sidebar to the contextual help.

param: string $content Sidebar content in plain text or HTML.
since: 3.3.0

get_columns()   X-Ref
Gets the number of layout columns the user has selected.

The layout_columns option controls the max number and default number of
columns. This method returns the number of columns within that range selected
by the user via Screen Options. If no selection has been made, the default
provisioned in layout_columns is returned. If the screen does not support
selecting the number of layout columns, 0 is returned.

return: int Number of columns to display.
since: 3.4.0

get_screen_reader_content()   X-Ref
Get the accessible hidden headings and text used in the screen.

return: array An associative array of screen reader text strings.
since: 4.4.0

get_screen_reader_text( $key )   X-Ref
Get a screen reader text string.

return: string Screen reader text string.
param: string $key Screen reader text array named key.
since: 4.4.0

set_screen_reader_content( $content = array()   X-Ref
Add accessible hidden headings and text for the screen.

param: array $content {
since: 4.4.0

remove_screen_reader_content()   X-Ref
Remove all the accessible hidden headings and text for the screen.

since: 4.4.0

render_screen_meta()   X-Ref
Render the screen's help section.

This will trigger the deprecated filters for backward compatibility.

since: 3.3.0

show_screen_options()   X-Ref

return: bool

render_screen_options( $options = array()   X-Ref
Render the screen options tab.

param: array $options {
since: 3.3.0

render_meta_boxes_preferences()   X-Ref
Render the meta boxes preferences.

since: 4.4.0

render_list_table_columns_preferences()   X-Ref
Render the list table columns preferences.

since: 4.4.0

render_screen_layout()   X-Ref
Render the option for number of columns on the page

since: 3.3.0

render_per_page_options()   X-Ref
Render the items per page option

since: 3.3.0

render_view_mode()   X-Ref
Render the list table view mode preferences.

since: 4.4.0

render_screen_reader_content( $key = '', $tag = 'h2' )   X-Ref
Render screen reader text.

param: string $key The screen reader text array named key.
param: string $tag Optional. The HTML tag to wrap the screen reader text. Default h2.
since: 4.4.0



Generated: Fri Dec 6 01:00:02 2024 Cross-referenced by PHPXref 0.7.1