wppaste
WordPress

WP_Customize_Control::render_content()

Since
3.4.0
Source
wp-includes/class-wp-customize-control.php:493
Renders the control's content.

Description

Allows the content to be overridden without having to rewrite the wrapper in $this::render().

Supports basic input types text, checkbox, textarea, radio, select and dropdown-pages.
Additional input types such as email, url, number, hidden and date are supported implicitly.

Control content can alternately be rendered in JS. See WP_Customize_Control::print_template().

Compatibility

WordPress
since 3.4.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 WP_Customize_Control::render_content() 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
Heavy

Reaches the database via get_post().

Scaling
Scales with input

The body loops, so the work grows with how much data it finds.

Instructions
14–176

Executed per call on PHP 8.5, depending on the branch taken. The body compiles to 519.

Plugin surface
None

Nothing here hands control to plugin code.

Called by
1

1 place in core call this, so the cost is paid more often than your own code shows.

What it touches

  • querycontent queryget_post()called directly
  • hookthird-party callbacksapply_filters()one call below WP_Customize_Control::render_content()
  • optionoption read or writeget_option()one call below WP_Customize_Control::render_content()

Further down the call graph this can also reach cache, serialize and transient. Those are the worst case, several calls deep and usually down an error path, not what a normal call pays.

What one call costs · 113 distinct outcomes

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

WhenInstructionsCalls it makes
empty($value)14–33none
always19–42esc_attr()
always36–41esc_html()
always36–43esc_attr(), ->link()
empty($value)40–48esc_attr(), ->input_attrs(), ->link(), ->value(), esc_textarea()
always41–42esc_attr(), esc_html()
always41–52esc_attr(), esc_attr(), ->link()
always42–43esc_attr(), esc_attr()
empty($value) && isset($value)43–54esc_attr(), esc_attr(), ->input_attrs(), ->link()
always45–50esc_html(), esc_attr()
always45–57esc_attr(), esc_attr(), ->input_attrs(), ->link(), ->value(), esc_textarea()
always49–56esc_attr(), esc_html(), esc_attr(), ->link()
101 further outcomes, up to 176 instructions
!empty($value)50–51esc_attr(), esc_html(), esc_attr()
always50–51esc_attr(), esc_attr(), esc_attr(), ->link()
empty($value) && !isset($value)51–62esc_attr(), esc_attr(), ->input_attrs(), ->value(), esc_attr(), ->link()
isset($value)52–63esc_attr(), esc_attr(), esc_attr(), ->input_attrs(), ->link()
empty($value)52–54esc_attr(), ->value(), esc_attr(), ->link(), ->value(), checked(), esc_attr(), esc_html()
always53–61esc_attr(), esc_html(), esc_attr(), ->input_attrs(), ->link(), ->value(), esc_textarea()
always54–55esc_attr(), esc_attr(), esc_html(), esc_attr(), ->link()
always54esc_attr(), esc_attr(), esc_attr(), ->input_attrs(), ->link(), ->value(), esc_textarea()
isset($value)56–67esc_attr(), esc_html(), esc_attr(), esc_attr(), ->input_attrs(), ->link()
always57esc_attr(), esc_attr(), ->value(), esc_attr(), ->link(), ->value(), checked(), esc_attr(), esc_html()
always58–65esc_attr(), esc_html(), esc_attr(), esc_attr(), ->link()
always58esc_attr(), esc_attr(), esc_html(), esc_attr(), ->input_attrs(), ->link(), ->value(), esc_textarea()
!isset($value)60–71esc_attr(), esc_attr(), esc_attr(), ->input_attrs(), ->value(), esc_attr(), ->link()
always61–63esc_attr(), ->value(), esc_attr(), ->link(), ->value(), checked(), esc_attr(), esc_html(), esc_attr()
always62–70esc_attr(), esc_html(), esc_attr(), esc_attr(), ->input_attrs(), ->link(), ->value(), esc_textarea()
!empty($value)63–64esc_attr(), esc_attr(), esc_html(), esc_attr(), esc_attr(), ->link()
empty($value) && !empty($dropdown)64–74__(), ->value(), name(), ->get_link(), esc_attr(), ->get_setting()
!isset($value)64–75esc_attr(), esc_html(), esc_attr(), esc_attr(), ->input_attrs(), ->value(), esc_attr(), ->link()
isset($value)65–76esc_attr(), esc_html(), esc_attr(), esc_attr(), esc_attr(), ->input_attrs(), ->link()
!empty($value)66esc_attr(), esc_attr(), ->value(), esc_attr(), ->link(), ->value(), checked(), esc_attr(), esc_html(), esc_attr()
!empty($value)67esc_attr(), esc_attr(), esc_html(), esc_attr(), esc_attr(), ->input_attrs(), ->link(), ->value(), esc_textarea()
empty($value) && !empty($dropdown) && !current_user_can()68–78__(), ->value(), name(), ->get_link(), esc_attr(), ->get_setting(), current_user_can()
!empty($dropdown)69–83esc_attr(), __(), ->value(), name(), ->get_link(), esc_attr(), ->get_setting()
empty($value) && !empty($dropdown) && !current_user_can()72–82__(), ->value(), name(), ->get_link(), esc_attr(), ->get_setting(), current_user_can(), current_user_can()
!empty($dropdown) && !current_user_can()73–87esc_attr(), __(), ->value(), name(), ->get_link(), esc_attr(), ->get_setting(), current_user_can()
!isset($value)73–84esc_attr(), esc_html(), esc_attr(), esc_attr(), esc_attr(), ->input_attrs(), ->value(), esc_attr(), ->link()
empty($value) && !empty($dropdown) && current_user_can()74–89__(), ->value(), name(), ->get_link(), esc_attr(), ->get_setting(), current_user_can(), ->value()
empty($value) && !empty($dropdown)76–86__(), ->value(), name(), ->get_link(), esc_attr(), ->get_setting(), current_user_can(), current_user_can(), current_user_can()
!empty($dropdown)77–87esc_attr(), esc_html(), __(), ->value(), name(), ->get_link(), esc_attr(), ->get_setting()
!empty($dropdown) && !current_user_can()77–91esc_attr(), __(), ->value(), name(), ->get_link(), esc_attr(), ->get_setting(), current_user_can(), current_user_can()
empty($value) && !empty($dropdown)78–93__(), ->value(), name(), ->get_link(), esc_attr(), ->get_setting(), current_user_can(), ->value(), current_user_can()
!empty($dropdown) && current_user_can()79–98esc_attr(), __(), ->value(), name(), ->get_link(), esc_attr(), ->get_setting(), current_user_can(), ->value()
!empty($dropdown) && !current_user_can()81–91esc_attr(), esc_html(), __(), ->value(), name(), ->get_link(), esc_attr(), ->get_setting(), current_user_can()
!empty($dropdown)81–95esc_attr(), __(), ->value(), name(), ->get_link(), esc_attr(), ->get_setting(), current_user_can(), current_user_can(), current_user_can()
empty($value) && !empty($dropdown)82–97__(), ->value(), name(), ->get_link(), esc_attr(), ->get_setting(), current_user_can(), ->value(), current_user_can(), current_user_can()
!empty($dropdown)83–102esc_attr(), __(), ->value(), name(), ->get_link(), esc_attr(), ->get_setting(), current_user_can(), ->value(), current_user_can()
!empty($dropdown) && !current_user_can()85–95esc_attr(), esc_html(), __(), ->value(), name(), ->get_link(), esc_attr(), ->get_setting(), current_user_can(), current_user_can()
empty($value) && empty($dropdown)85–95__(), ->value(), name(), esc_attr(), sprintf(), esc_attr(), esc_html(), sprintf(), ->get_link(), esc_attr(), ->get_setting()
!empty($dropdown)86–96esc_attr(), esc_html(), esc_attr(), __(), ->value(), name(), ->get_link(), esc_attr(), ->get_setting()
!empty($dropdown) && current_user_can()87–102esc_attr(), esc_html(), __(), ->value(), name(), ->get_link(), esc_attr(), ->get_setting(), current_user_can(), ->value()
!empty($dropdown)87–106esc_attr(), __(), ->value(), name(), ->get_link(), esc_attr(), ->get_setting(), current_user_can(), ->value(), current_user_can(), current_user_can()
!empty($dropdown)89–99esc_attr(), esc_html(), __(), ->value(), name(), ->get_link(), esc_attr(), ->get_setting(), current_user_can(), current_user_can(), current_user_can()
empty($value) && empty($dropdown) && !current_user_can()89–99__(), ->value(), name(), esc_attr(), sprintf(), esc_attr(), esc_html(), sprintf(), ->get_link(), esc_attr(), ->get_setting(), current_user_can()
!empty($dropdown) && !current_user_can()90–100esc_attr(), esc_html(), esc_attr(), __(), ->value(), name(), ->get_link(), esc_attr(), ->get_setting(), current_user_can()
empty($dropdown)90–104esc_attr(), __(), ->value(), name(), esc_attr(), sprintf(), esc_attr(), esc_html(), sprintf(), ->get_link(), esc_attr(), ->get_setting()
!empty($dropdown)91–106esc_attr(), esc_html(), __(), ->value(), name(), ->get_link(), esc_attr(), ->get_setting(), current_user_can(), ->value(), current_user_can()
empty($value) && empty($dropdown) && !current_user_can()93–103__(), ->value(), name(), esc_attr(), sprintf(), esc_attr(), esc_html(), sprintf(), ->get_link(), esc_attr(), ->get_setting(), current_user_can(), current_user_can()
!empty($dropdown) && !current_user_can()94–104esc_attr(), esc_html(), esc_attr(), __(), ->value(), name(), ->get_link(), esc_attr(), ->get_setting(), current_user_can(), current_user_can()
empty($dropdown) && !current_user_can()94–108esc_attr(), __(), ->value(), name(), esc_attr(), sprintf(), esc_attr(), esc_html(), sprintf(), ->get_link(), esc_attr(), ->get_setting(), current_user_can()
!empty($dropdown)95–110esc_attr(), esc_html(), __(), ->value(), name(), ->get_link(), esc_attr(), ->get_setting(), current_user_can(), ->value(), current_user_can(), current_user_can()
empty($value) && empty($dropdown) && current_user_can()95–110__(), ->value(), name(), esc_attr(), sprintf(), esc_attr(), esc_html(), sprintf(), ->get_link(), esc_attr(), ->get_setting(), current_user_can(), ->value()
!empty($dropdown) && current_user_can()96–111esc_attr(), esc_html(), esc_attr(), __(), ->value(), name(), ->get_link(), esc_attr(), ->get_setting(), current_user_can(), ->value()
empty($value) && empty($dropdown)97–107__(), ->value(), name(), esc_attr(), sprintf(), esc_attr(), esc_html(), sprintf(), ->get_link(), esc_attr(), ->get_setting(), current_user_can(), current_user_can(), current_user_can()
!empty($dropdown)98–108esc_attr(), esc_html(), esc_attr(), __(), ->value(), name(), ->get_link(), esc_attr(), ->get_setting(), current_user_can(), current_user_can(), current_user_can()
empty($dropdown)98–108esc_attr(), esc_html(), __(), ->value(), name(), esc_attr(), sprintf(), esc_attr(), esc_html(), sprintf(), ->get_link(), esc_attr(), ->get_setting()
empty($dropdown) && !current_user_can()98–112esc_attr(), __(), ->value(), name(), esc_attr(), sprintf(), esc_attr(), esc_html(), sprintf(), ->get_link(), esc_attr(), ->get_setting(), current_user_can(), current_user_can()
empty($value) && empty($dropdown)99–114__(), ->value(), name(), esc_attr(), sprintf(), esc_attr(), esc_html(), sprintf(), ->get_link(), esc_attr(), ->get_setting(), current_user_can(), ->value(), current_user_can()
!empty($dropdown)100–115esc_attr(), esc_html(), esc_attr(), __(), ->value(), name(), ->get_link(), esc_attr(), ->get_setting(), current_user_can(), ->value(), current_user_can()
empty($dropdown) && !current_user_can()102–112esc_attr(), esc_html(), __(), ->value(), name(), esc_attr(), sprintf(), esc_attr(), esc_html(), sprintf(), ->get_link(), esc_attr(), ->get_setting(), current_user_can()
empty($value) && empty($dropdown)103–118__(), ->value(), name(), esc_attr(), sprintf(), esc_attr(), esc_html(), sprintf(), ->get_link(), esc_attr(), ->get_setting(), current_user_can(), ->value(), current_user_can(), current_user_can()
!empty($dropdown)104–119esc_attr(), esc_html(), esc_attr(), __(), ->value(), name(), ->get_link(), esc_attr(), ->get_setting(), current_user_can(), ->value(), current_user_can(), current_user_can()
empty($dropdown) && current_user_can()104–119esc_attr(), __(), ->value(), name(), esc_attr(), sprintf(), esc_attr(), esc_html(), sprintf(), ->get_link(), esc_attr(), ->get_setting(), current_user_can(), ->value()
empty($dropdown)106–116esc_attr(), __(), ->value(), name(), esc_attr(), sprintf(), esc_attr(), esc_html(), sprintf(), ->get_link(), esc_attr(), ->get_setting(), current_user_can(), current_user_can(), current_user_can()
empty($dropdown) && !current_user_can()106–116esc_attr(), esc_html(), __(), ->value(), name(), esc_attr(), sprintf(), esc_attr(), esc_html(), sprintf(), ->get_link(), esc_attr(), ->get_setting(), current_user_can(), current_user_can()
empty($dropdown)107–117esc_attr(), esc_html(), esc_attr(), __(), ->value(), name(), esc_attr(), sprintf(), esc_attr(), esc_html(), sprintf(), ->get_link(), esc_attr(), ->get_setting()
empty($value) && !empty($dropdown) && current_user_can()108–118__(), ->value(), name(), ->get_link(), esc_attr(), ->get_setting(), current_user_can(), current_user_can(), __(), get_post_type_object(), printf(), esc_attr(), _e(), esc_attr(), _e()
empty($dropdown)108–123esc_attr(), __(), ->value(), name(), esc_attr(), sprintf(), esc_attr(), esc_html(), sprintf(), ->get_link(), esc_attr(), ->get_setting(), current_user_can(), ->value(), current_user_can()
empty($dropdown) && current_user_can()108–123esc_attr(), esc_html(), __(), ->value(), name(), esc_attr(), sprintf(), esc_attr(), esc_html(), sprintf(), ->get_link(), esc_attr(), ->get_setting(), current_user_can(), ->value()
empty($dropdown)110–120esc_attr(), esc_html(), __(), ->value(), name(), esc_attr(), sprintf(), esc_attr(), esc_html(), sprintf(), ->get_link(), esc_attr(), ->get_setting(), current_user_can(), current_user_can(), current_user_can()
empty($dropdown) && !current_user_can()111–121esc_attr(), esc_html(), esc_attr(), __(), ->value(), name(), esc_attr(), sprintf(), esc_attr(), esc_html(), sprintf(), ->get_link(), esc_attr(), ->get_setting(), current_user_can()
empty($value) && !empty($dropdown)112–122__(), ->value(), name(), ->get_link(), esc_attr(), ->get_setting(), current_user_can(), current_user_can(), current_user_can(), __(), get_post_type_object(), printf(), esc_attr(), _e(), esc_attr(), _e()
empty($dropdown)112–127esc_attr(), __(), ->value(), name(), esc_attr(), sprintf(), esc_attr(), esc_html(), sprintf(), ->get_link(), esc_attr(), ->get_setting(), current_user_can(), ->value(), current_user_can(), current_user_can()
empty($dropdown)112–127esc_attr(), esc_html(), __(), ->value(), name(), esc_attr(), sprintf(), esc_attr(), esc_html(), sprintf(), ->get_link(), esc_attr(), ->get_setting(), current_user_can(), ->value(), current_user_can()
!empty($dropdown) && current_user_can()113–127esc_attr(), __(), ->value(), name(), ->get_link(), esc_attr(), ->get_setting(), current_user_can(), current_user_can(), __(), get_post_type_object(), printf(), esc_attr(), _e(), esc_attr(), _e()
empty($dropdown) && !current_user_can()115–125esc_attr(), esc_html(), esc_attr(), __(), ->value(), name(), esc_attr(), sprintf(), esc_attr(), esc_html(), sprintf(), ->get_link(), esc_attr(), ->get_setting(), current_user_can(), current_user_can()
empty($dropdown)116–131esc_attr(), esc_html(), __(), ->value(), name(), esc_attr(), sprintf(), esc_attr(), esc_html(), sprintf(), ->get_link(), esc_attr(), ->get_setting(), current_user_can(), ->value(), current_user_can(), current_user_can()
empty($dropdown) && current_user_can()117–132esc_attr(), esc_html(), esc_attr(), __(), ->value(), name(), esc_attr(), sprintf(), esc_attr(), esc_html(), sprintf(), ->get_link(), esc_attr(), ->get_setting(), current_user_can(), ->value()
!empty($dropdown)117–131esc_attr(), __(), ->value(), name(), ->get_link(), esc_attr(), ->get_setting(), current_user_can(), current_user_can(), current_user_can(), __(), get_post_type_object(), printf(), esc_attr(), _e(), esc_attr(), _e()
empty($value) && !empty($dropdown) && current_user_can()118–133__(), ->value(), name(), ->get_link(), esc_attr(), ->get_setting(), current_user_can(), ->value(), current_user_can(), current_user_can(), __(), get_post_type_object(), printf(), esc_attr(), _e(), esc_attr(), _e()
empty($dropdown)119–129esc_attr(), esc_html(), esc_attr(), __(), ->value(), name(), esc_attr(), sprintf(), esc_attr(), esc_html(), sprintf(), ->get_link(), esc_attr(), ->get_setting(), current_user_can(), current_user_can(), current_user_can()
!empty($dropdown) && current_user_can()121–131esc_attr(), esc_html(), __(), ->value(), name(), ->get_link(), esc_attr(), ->get_setting(), current_user_can(), current_user_can(), __(), get_post_type_object(), printf(), esc_attr(), _e(), esc_attr(), _e()
empty($dropdown)121–136esc_attr(), esc_html(), esc_attr(), __(), ->value(), name(), esc_attr(), sprintf(), esc_attr(), esc_html(), sprintf(), ->get_link(), esc_attr(), ->get_setting(), current_user_can(), ->value(), current_user_can()
!empty($dropdown) && current_user_can()123–142esc_attr(), __(), ->value(), name(), ->get_link(), esc_attr(), ->get_setting(), current_user_can(), ->value(), current_user_can(), current_user_can(), __(), get_post_type_object(), printf(), esc_attr(), _e(), esc_attr(), _e()
!empty($dropdown)125–135esc_attr(), esc_html(), __(), ->value(), name(), ->get_link(), esc_attr(), ->get_setting(), current_user_can(), current_user_can(), current_user_can(), __(), get_post_type_object(), printf(), esc_attr(), _e(), esc_attr(), _e()
empty($dropdown)125–140esc_attr(), esc_html(), esc_attr(), __(), ->value(), name(), esc_attr(), sprintf(), esc_attr(), esc_html(), sprintf(), ->get_link(), esc_attr(), ->get_setting(), current_user_can(), ->value(), current_user_can(), current_user_can()
empty($value) && empty($dropdown) && current_user_can()129–139__(), ->value(), name(), esc_attr(), sprintf(), esc_attr(), esc_html(), sprintf(), ->get_link(), esc_attr(), ->get_setting(), current_user_can(), current_user_can(), __(), get_post_type_object(), printf(), esc_attr(), _e(), esc_attr(), _e()
!empty($dropdown) && current_user_can()130–140esc_attr(), esc_html(), esc_attr(), __(), ->value(), name(), ->get_link(), esc_attr(), ->get_setting(), current_user_can(), current_user_can(), __(), get_post_type_object(), printf(), esc_attr(), _e(), esc_attr(), _e()
!empty($dropdown) && current_user_can()131–146esc_attr(), esc_html(), __(), ->value(), name(), ->get_link(), esc_attr(), ->get_setting(), current_user_can(), ->value(), current_user_can(), current_user_can(), __(), get_post_type_object(), printf(), esc_attr(), _e(), esc_attr(), _e()
empty($value) && empty($dropdown)133–143__(), ->value(), name(), esc_attr(), sprintf(), esc_attr(), esc_html(), sprintf(), ->get_link(), esc_attr(), ->get_setting(), current_user_can(), current_user_can(), current_user_can(), __(), get_post_type_object(), printf(), esc_attr(), _e(), esc_attr(), _e()
!empty($dropdown)134–144esc_attr(), esc_html(), esc_attr(), __(), ->value(), name(), ->get_link(), esc_attr(), ->get_setting(), current_user_can(), current_user_can(), current_user_can(), __(), get_post_type_object(), printf(), esc_attr(), _e(), esc_attr(), _e()
empty($dropdown) && current_user_can()134–148esc_attr(), __(), ->value(), name(), esc_attr(), sprintf(), esc_attr(), esc_html(), sprintf(), ->get_link(), esc_attr(), ->get_setting(), current_user_can(), current_user_can(), __(), get_post_type_object(), printf(), esc_attr(), _e(), esc_attr(), _e()
empty($value) && empty($dropdown) && current_user_can()139–154__(), ->value(), name(), esc_attr(), sprintf(), esc_attr(), esc_html(), sprintf(), ->get_link(), esc_attr(), ->get_setting(), current_user_can(), ->value(), current_user_can(), current_user_can(), __(), get_post_type_object(), printf(), esc_attr(), _e(), esc_attr(), _e()
!empty($dropdown) && current_user_can()140–155esc_attr(), esc_html(), esc_attr(), __(), ->value(), name(), ->get_link(), esc_attr(), ->get_setting(), current_user_can(), ->value(), current_user_can(), current_user_can(), __(), get_post_type_object(), printf(), esc_attr(), _e(), esc_attr(), _e()
empty($dropdown)142–152esc_attr(), __(), ->value(), name(), esc_attr(), sprintf(), esc_attr(), esc_html(), sprintf(), ->get_link(), esc_attr(), ->get_setting(), current_user_can(), current_user_can(), current_user_can(), __(), get_post_type_object(), printf(), esc_attr(), _e(), esc_attr(), _e()
empty($dropdown) && current_user_can()142–152esc_attr(), esc_html(), __(), ->value(), name(), esc_attr(), sprintf(), esc_attr(), esc_html(), sprintf(), ->get_link(), esc_attr(), ->get_setting(), current_user_can(), current_user_can(), __(), get_post_type_object(), printf(), esc_attr(), _e(), esc_attr(), _e()
empty($dropdown)146–156esc_attr(), esc_html(), __(), ->value(), name(), esc_attr(), sprintf(), esc_attr(), esc_html(), sprintf(), ->get_link(), esc_attr(), ->get_setting(), current_user_can(), current_user_can(), current_user_can(), __(), get_post_type_object(), printf(), esc_attr(), _e(), esc_attr(), _e()
empty($dropdown) && current_user_can()148–163esc_attr(), __(), ->value(), name(), esc_attr(), sprintf(), esc_attr(), esc_html(), sprintf(), ->get_link(), esc_attr(), ->get_setting(), current_user_can(), ->value(), current_user_can(), current_user_can(), __(), get_post_type_object(), printf(), esc_attr(), _e(), esc_attr(), _e()
empty($dropdown) && current_user_can()151–161esc_attr(), esc_html(), esc_attr(), __(), ->value(), name(), esc_attr(), sprintf(), esc_attr(), esc_html(), sprintf(), ->get_link(), esc_attr(), ->get_setting(), current_user_can(), current_user_can(), __(), get_post_type_object(), printf(), esc_attr(), _e(), esc_attr(), _e()
empty($dropdown) && current_user_can()152–167esc_attr(), esc_html(), __(), ->value(), name(), esc_attr(), sprintf(), esc_attr(), esc_html(), sprintf(), ->get_link(), esc_attr(), ->get_setting(), current_user_can(), ->value(), current_user_can(), current_user_can(), __(), get_post_type_object(), printf(), esc_attr(), _e(), esc_attr(), _e()
empty($dropdown)155–165esc_attr(), esc_html(), esc_attr(), __(), ->value(), name(), esc_attr(), sprintf(), esc_attr(), esc_html(), sprintf(), ->get_link(), esc_attr(), ->get_setting(), current_user_can(), current_user_can(), current_user_can(), __(), get_post_type_object(), printf(), esc_attr(), _e(), esc_attr(), _e()
empty($dropdown) && current_user_can()161–176esc_attr(), esc_html(), esc_attr(), __(), ->value(), name(), esc_attr(), sprintf(), esc_attr(), esc_html(), sprintf(), ->get_link(), esc_attr(), ->get_setting(), current_user_can(), ->value(), current_user_can(), current_user_can(), __(), get_post_type_object(), printf(), esc_attr(), _e(), esc_attr(), _e()

This body has more branch combinations than are worth enumerating, so the table covers the outcomes found first rather than every one that exists.

Across PHP versions

PHPCompiledExecutedBranchesNotes
8.6-dev51914–17636
8.551914–17636
8.451914–176366 fewer instructions than PHP 8.3
8.352514–18236
8.252514–182361 more instruction than PHP 8.1
8.152414–182361 fewer instruction than PHP 7.4
7.452514–18236

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 · 15

Show all 15

Used by · 1

Source code

	protected function render_content() {		$input_id         = '_customize-input-' . $this->id;		$description_id   = '_customize-description-' . $this->id;		$describedby_attr = ( ! empty( $this->description ) ) ? ' aria-describedby="' . esc_attr( $description_id ) . '" ' : '';		switch ( $this->type ) {			case 'checkbox':				?>				<span class="customize-inside-control-row">					<input						id="<?php echo esc_attr( $input_id ); ?>"						<?php echo $describedby_attr; ?>						type="checkbox"						value="<?php echo esc_attr( $this->value() ); ?>"						<?php $this->link(); ?>						<?php checked( $this->value() ); ?>					/>					<label for="<?php echo esc_attr( $input_id ); ?>"><?php echo esc_html( $this->label ); ?></label>					<?php if ( ! empty( $this->description ) ) : ?>						<span id="<?php echo esc_attr( $description_id ); ?>" class="description customize-control-description"><?php echo $this->description; ?></span>					<?php endif; ?>				</span>				<?php				break;			case 'radio':				if ( empty( $this->choices ) ) {					return;				} 				$name = '_customize-radio-' . $this->id;				?>				<?php if ( ! empty( $this->label ) ) : ?>					<span class="customize-control-title"><?php echo esc_html( $this->label ); ?></span>				<?php endif; ?>				<?php if ( ! empty( $this->description ) ) : ?>					<span id="<?php echo esc_attr( $description_id ); ?>" class="description customize-control-description"><?php echo $this->description; ?></span>				<?php endif; ?> 				<?php foreach ( $this->choices as $value => $label ) : ?>					<span class="customize-inside-control-row">						<input							id="<?php echo esc_attr( $input_id . '-radio-' . $value ); ?>"							type="radio"							<?php echo $describedby_attr; ?>							value="<?php echo esc_attr( $value ); ?>"							name="<?php echo esc_attr( $name ); ?>"							<?php $this->link(); ?>							<?php checked( $this->value(), $value ); ?>							/>						<label for="<?php echo esc_attr( $input_id . '-radio-' . $value ); ?>"><?php echo esc_html( $label ); ?></label>					</span>				<?php endforeach; ?>				<?php				break;			case 'select':				if ( empty( $this->choices ) ) {					return;				} 				?>				<?php if ( ! empty( $this->label ) ) : ?>					<label for="<?php echo esc_attr( $input_id ); ?>" class="customize-control-title"><?php echo esc_html( $this->label ); ?></label>				<?php endif; ?>				<?php if ( ! empty( $this->description ) ) : ?>					<span id="<?php echo esc_attr( $description_id ); ?>" class="description customize-control-description"><?php echo $this->description; ?></span>				<?php endif; ?> 				<select id="<?php echo esc_attr( $input_id ); ?>" <?php echo $describedby_attr; ?> <?php $this->link(); ?>>					<?php					foreach ( $this->choices as $value => $label ) {						echo '<option value="' . esc_attr( $value ) . '"' . selected( $this->value(), $value, false ) . '>' . esc_html( $label ) . '</option>';					}					?>				</select>				<?php				break;			case 'textarea':				?>				<?php if ( ! empty( $this->label ) ) : ?>					<label for="<?php echo esc_attr( $input_id ); ?>" class="customize-control-title"><?php echo esc_html( $this->label ); ?></label>				<?php endif; ?>

Changelog

Introduced in 3.4.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-includes/class-wp-customize-control.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.