wppaste
WordPress

Custom_Image_Header::help()

Since
3.0.0
Source
wp-admin/includes/class-custom-image-header.php:104
Adds contextual help.

Compatibility

WordPress
since 3.0.0
PHP
7.4–8.6-dev
  • 6.7.7
  • 6.8.8
  • 6.9.7
  • 7.0.4
  • 7.1.0

Present in every tracked release (6.7.7 to 7.1.0), and compiles on PHP 7.4 through 8.6-dev.

Performance profile

How much work a call to Custom_Image_Header::help() does, and what it touches: the algorithmic scaling, the Zend instruction count per call across PHP versions, the hooks it hands control to, and the core code that calls it. Measured from the compiled opcodes, not a stopwatch, so every number is identical on any machine running the same PHP version, and every function in core is ranked by cost.

Cost class
Trivial

Touches nothing outside its own arguments.

Scaling
Constant

No loop in the body: the same number of instructions runs whatever you pass in.

Instructions
106

Executed per call on PHP 8.5. The body compiles to 106.

Plugin surface
None

Nothing here hands control to plugin code.

Called by
0

Nothing in core calls this; the cost is only what you spend yourself.

What one call costs · 1 distinct outcome

One number would be a lie: the work depends on which branch runs. These are every distinct cost Custom_Image_Header::help() can have, taken from its control-flow graph on PHP 8.5.

WhenInstructionsCalls it makes
always106get_current_screen(), __(), __(), __(), overview(), get_current_screen(), __(), __(), __(), __(), __(), set-header-image(), get_current_screen(), __(), __(), admin_url(), sprintf(), __(), __(), set-header-text(), get_current_screen(), __(), __(), __(), ->set_help_sidebar()

Across PHP versions

Compiles the same on PHP 7.4, 8.1, 8.2, 8.3, 8.4, 8.5 and 8.6-dev: 106 instructions, 106 executed per call, 0 branches. The work does not change between versions.

An instruction is not a fixed amount of time, so a matching count is not necessarily the same speed; what it rules out is a difference in the work itself.

Uses · 5

  • get_current_screen()Get the current screen object
  • __()Retrieves the translation of $text.
  • admin_url()Retrieves the URL to the admin area for the current site.
  • get_current_screen()::add_help_tab()
  • get_current_screen()::set_help_sidebar()

Source code

	public function help() {		get_current_screen()->add_help_tab(			array(				'id'      => 'overview',				'title'   => __( 'Overview' ),				'content' =>					'<p>' . __( 'This screen is used to customize the header section of your theme.' ) . '</p>' .					'<p>' . __( 'You can choose from the theme&#8217;s default header images, or use one of your own. You can also customize how your Site Title and Tagline are displayed.' ) . '<p>',			)		); 		get_current_screen()->add_help_tab(			array(				'id'      => 'set-header-image',				'title'   => __( 'Header Image' ),				'content' =>					'<p>' . __( 'You can set a custom image header for your site. Simply upload the image and crop it, and the new header will go live immediately. Alternatively, you can use an image that has already been uploaded to your Media Library by clicking the &#8220;Choose Image&#8221; button.' ) . '</p>' .					'<p>' . __( 'Some themes come with additional header images bundled. If you see multiple images displayed, select the one you would like and click the &#8220;Save Changes&#8221; button.' ) . '</p>' .					'<p>' . __( 'If your theme has more than one default header image, or you have uploaded more than one custom header image, you have the option of having WordPress display a randomly different image on each page of your site. Click the &#8220;Random&#8221; radio button next to the Uploaded Images or Default Images section to enable this feature.' ) . '</p>' .					'<p>' . __( 'If you do not want a header image to be displayed on your site at all, click the &#8220;Remove Header Image&#8221; button at the bottom of the Header Image section of this page. If you want to re-enable the header image later, you just have to select one of the other image options and click &#8220;Save Changes&#8221;.' ) . '</p>',			)		); 		get_current_screen()->add_help_tab(			array(				'id'      => 'set-header-text',				'title'   => __( 'Header Text' ),				'content' =>					'<p>' . sprintf(						/* translators: %s: URL to General Settings screen. */						__( 'For most themes, the header text is your Site Title and Tagline, as defined in the <a href="%s">General Settings</a> section.' ),						admin_url( 'options-general.php' )					) .					'</p>' .					'<p>' . __( 'In the Header Text section of this page, you can choose whether to display this text or hide it. You can also choose a color for the text by clicking the Select Color button and either typing in a legitimate HTML hex value, e.g. &#8220;#ff0000&#8221; for red, or by choosing a color using the color picker.' ) . '</p>' .					'<p>' . __( 'Do not forget to click &#8220;Save Changes&#8221; when you are done!' ) . '</p>',			)		); 		get_current_screen()->set_help_sidebar(			'<p><strong>' . __( 'For more information:' ) . '</strong></p>' .			'<p>' . __( '<a href="https://codex.wordpress.org/Appearance_Header_Screen">Documentation on Custom Header</a>' ) . '</p>' .			'<p>' . __( '<a href="https://wordpress.org/support/forums/">Support forums</a>' ) . '</p>'		);	}

Changelog

Introduced in 3.0.0. Unchanged from 6.7.7 through 7.1.0.

  1. 6.7.7
  2. 6.8.8
  3. 6.9.7
  4. 7.0.4
  5. 7.1.0

Signature, return type and hooks compared across 5 parsed releases.

About this page

Parsed data
Generated from the wordpress-develop 6.8.8 tag, from src/wp-admin/includes/class-custom-image-header.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.
Corrections
Something wrong on this page? Report it and it gets fixed in the next regeneration.