WP_Customize_Control::render_content()
- Since
- 3.4.0
- Source
wp-includes/class-wp-customize-control.php:493
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
- Scaling
- Scales with input
- Instructions
- 14–187
- Plugin surface
- None
- Called by
- 1
Reaches the database via get_post().
The body loops, so the work grows with how much data it finds.
Executed per call on PHP 8.5, depending on the branch taken. The body compiles to 536.
Nothing here hands control to plugin code.
1 place in core call this, so the cost is paid more often than your own code shows.
What it touches
- querycontent query
get_post()called directly - hookthird-party callbacks
apply_filters()one call below WP_Customize_Control::render_content() - optionoption read or write
get_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.
| When | Instructions | Calls it makes |
|---|---|---|
empty($value) | 14–33 | none |
| always | 19–42 | esc_attr() |
| always | 36–41 | esc_html() |
| always | 36–43 | esc_attr(), ->link() |
| always | 41–42 | esc_attr(), esc_html() |
| always | 41–52 | esc_attr(), esc_attr(), ->link() |
| always | 42–43 | esc_attr(), esc_attr() |
empty($value) && isset($value) | 43–54 | esc_attr(), esc_attr(), ->input_attrs(), ->link() |
empty($value) | 43–54 | esc_attr(), ->input_attrs(), ->link(), ->value(), esc_textarea() |
| always | 45–50 | esc_html(), esc_attr() |
| always | 48–63 | esc_attr(), esc_attr(), ->input_attrs(), ->link(), ->value(), esc_textarea() |
| always | 49–56 | esc_attr(), esc_html(), esc_attr(), ->link() |
101 further outcomes, up to 187 instructions
!empty($value) | 50–51 | esc_attr(), esc_html(), esc_attr() |
| always | 50–51 | esc_attr(), esc_attr(), esc_attr(), ->link() |
empty($value) && !isset($value) | 51–62 | esc_attr(), esc_attr(), ->input_attrs(), ->value(), esc_attr(), ->link() |
isset($value) | 52–63 | esc_attr(), esc_attr(), esc_attr(), ->input_attrs(), ->link() |
empty($value) | 52–54 | esc_attr(), ->value(), esc_attr(), ->link(), ->value(), checked(), esc_attr(), esc_html() |
| always | 54–55 | esc_attr(), esc_attr(), esc_html(), esc_attr(), ->link() |
isset($value) | 56–67 | esc_attr(), esc_html(), esc_attr(), esc_attr(), ->input_attrs(), ->link() |
| always | 56–67 | esc_attr(), esc_html(), esc_attr(), ->input_attrs(), ->link(), ->value(), esc_textarea() |
| always | 57–60 | esc_attr(), esc_attr(), esc_attr(), ->input_attrs(), ->link(), ->value(), esc_textarea() |
| always | 57 | esc_attr(), esc_attr(), ->value(), esc_attr(), ->link(), ->value(), checked(), esc_attr(), esc_html() |
| always | 58–65 | esc_attr(), esc_html(), esc_attr(), esc_attr(), ->link() |
!isset($value) | 60–71 | esc_attr(), esc_attr(), esc_attr(), ->input_attrs(), ->value(), esc_attr(), ->link() |
| always | 61–64 | esc_attr(), esc_attr(), esc_html(), esc_attr(), ->input_attrs(), ->link(), ->value(), esc_textarea() |
| always | 61–63 | esc_attr(), ->value(), esc_attr(), ->link(), ->value(), checked(), esc_attr(), esc_html(), esc_attr() |
!empty($value) | 63–64 | esc_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–75 | esc_attr(), esc_html(), esc_attr(), esc_attr(), ->input_attrs(), ->value(), esc_attr(), ->link() |
isset($value) | 65–76 | esc_attr(), esc_html(), esc_attr(), esc_attr(), esc_attr(), ->input_attrs(), ->link() |
| always | 65–76 | esc_attr(), esc_html(), esc_attr(), esc_attr(), ->input_attrs(), ->link(), ->value(), esc_textarea() |
!empty($value) | 66 | esc_attr(), esc_attr(), ->value(), esc_attr(), ->link(), ->value(), checked(), esc_attr(), esc_html(), esc_attr() |
empty($value) && !empty($dropdown) && !current_user_can() | 68–78 | __(), ->value(), name(), ->get_link(), esc_attr(), ->get_setting(), current_user_can() |
!empty($dropdown) | 69–83 | esc_attr(), __(), ->value(), name(), ->get_link(), esc_attr(), ->get_setting() |
!empty($value) | 70–73 | esc_attr(), esc_attr(), esc_html(), esc_attr(), esc_attr(), ->input_attrs(), ->link(), ->value(), esc_textarea() |
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–87 | esc_attr(), __(), ->value(), name(), ->get_link(), esc_attr(), ->get_setting(), current_user_can() |
!isset($value) | 73–84 | esc_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–87 | esc_attr(), esc_html(), __(), ->value(), name(), ->get_link(), esc_attr(), ->get_setting() |
!empty($dropdown) && !current_user_can() | 77–91 | esc_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–98 | esc_attr(), __(), ->value(), name(), ->get_link(), esc_attr(), ->get_setting(), current_user_can(), ->value() |
!empty($dropdown) && !current_user_can() | 81–91 | esc_attr(), esc_html(), __(), ->value(), name(), ->get_link(), esc_attr(), ->get_setting(), current_user_can() |
!empty($dropdown) | 81–95 | esc_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–102 | esc_attr(), __(), ->value(), name(), ->get_link(), esc_attr(), ->get_setting(), current_user_can(), ->value(), current_user_can() |
!empty($dropdown) && !current_user_can() | 85–95 | esc_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–96 | esc_attr(), esc_html(), esc_attr(), __(), ->value(), name(), ->get_link(), esc_attr(), ->get_setting() |
!empty($dropdown) && current_user_can() | 87–102 | esc_attr(), esc_html(), __(), ->value(), name(), ->get_link(), esc_attr(), ->get_setting(), current_user_can(), ->value() |
!empty($dropdown) | 87–106 | esc_attr(), __(), ->value(), name(), ->get_link(), esc_attr(), ->get_setting(), current_user_can(), ->value(), current_user_can(), current_user_can() |
!empty($dropdown) | 89–99 | esc_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–100 | esc_attr(), esc_html(), esc_attr(), __(), ->value(), name(), ->get_link(), esc_attr(), ->get_setting(), current_user_can() |
!empty($dropdown) | 91–106 | esc_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–104 | esc_attr(), esc_html(), esc_attr(), __(), ->value(), name(), ->get_link(), esc_attr(), ->get_setting(), current_user_can(), current_user_can() |
empty($dropdown) | 94–104 | esc_attr(), __(), ->value(), name(), esc_attr(), sprintf(), esc_attr(), esc_html(), sprintf(), ->get_link(), esc_attr(), ->get_setting() |
!empty($dropdown) | 95–110 | esc_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–111 | esc_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–108 | esc_attr(), esc_html(), esc_attr(), __(), ->value(), name(), ->get_link(), esc_attr(), ->get_setting(), current_user_can(), current_user_can(), current_user_can() |
empty($dropdown) && !current_user_can() | 98–108 | esc_attr(), __(), ->value(), name(), esc_attr(), sprintf(), esc_attr(), esc_html(), sprintf(), ->get_link(), esc_attr(), ->get_setting(), current_user_can() |
empty($dropdown) | 98–108 | esc_attr(), esc_html(), __(), ->value(), name(), esc_attr(), sprintf(), esc_attr(), esc_html(), sprintf(), ->get_link(), esc_attr(), ->get_setting() |
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–115 | esc_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–112 | 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) && !current_user_can() | 102–112 | esc_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–119 | esc_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–119 | esc_attr(), __(), ->value(), name(), esc_attr(), sprintf(), esc_attr(), esc_html(), sprintf(), ->get_link(), esc_attr(), ->get_setting(), current_user_can(), ->value() |
empty($dropdown) | 106–116 | 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() | 106–116 | esc_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–117 | esc_attr(), esc_html(), esc_attr(), __(), ->value(), name(), esc_attr(), sprintf(), esc_attr(), esc_html(), sprintf(), ->get_link(), esc_attr(), ->get_setting() |
empty($dropdown) | 108–123 | 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() | 108–123 | esc_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–120 | esc_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–121 | esc_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($dropdown) | 112–127 | 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($dropdown) | 112–127 | esc_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() | 115–125 | esc_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–131 | esc_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–132 | esc_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($value) && !empty($dropdown) && current_user_can() | 119–129 | __(), ->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(), esc_attr(), _e() |
empty($dropdown) | 119–129 | esc_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) | 121–136 | esc_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($value) && !empty($dropdown) | 123–133 | __(), ->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(), esc_attr(), _e() |
!empty($dropdown) && current_user_can() | 124–138 | 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(), esc_attr(), _e() |
empty($dropdown) | 125–140 | esc_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($dropdown) | 128–142 | 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(), esc_attr(), _e() |
empty($value) && !empty($dropdown) && current_user_can() | 129–144 | __(), ->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(), esc_attr(), _e() |
!empty($dropdown) && current_user_can() | 132–142 | esc_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(), esc_attr(), _e() |
!empty($dropdown) && current_user_can() | 134–153 | 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(), esc_attr(), _e() |
!empty($dropdown) | 136–146 | esc_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(), esc_attr(), _e() |
empty($value) && empty($dropdown) && current_user_can() | 140–150 | __(), ->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(), esc_attr(), _e() |
!empty($dropdown) && current_user_can() | 141–151 | esc_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(), esc_attr(), _e() |
!empty($dropdown) && current_user_can() | 142–157 | esc_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(), esc_attr(), _e() |
empty($value) && empty($dropdown) | 144–154 | __(), ->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(), esc_attr(), _e() |
!empty($dropdown) | 145–155 | esc_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(), esc_attr(), _e() |
empty($dropdown) && current_user_can() | 149–159 | 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(), esc_attr(), _e() |
empty($value) && empty($dropdown) && current_user_can() | 150–165 | __(), ->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(), esc_attr(), _e() |
!empty($dropdown) && current_user_can() | 151–166 | esc_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(), esc_attr(), _e() |
empty($dropdown) | 153–163 | 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(), esc_attr(), _e() |
empty($dropdown) && current_user_can() | 153–163 | esc_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(), esc_attr(), _e() |
empty($dropdown) | 157–167 | esc_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(), esc_attr(), _e() |
empty($dropdown) && current_user_can() | 159–174 | 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(), esc_attr(), _e() |
empty($dropdown) && current_user_can() | 162–172 | esc_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(), esc_attr(), _e() |
empty($dropdown) && current_user_can() | 163–178 | esc_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(), esc_attr(), _e() |
empty($dropdown) | 166–176 | esc_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(), esc_attr(), _e() |
empty($dropdown) && current_user_can() | 172–187 | esc_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(), 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
| PHP | Compiled | Executed | Branches | Notes |
|---|---|---|---|---|
| 8.6-dev | 536 | 14–187 | 37 | |
| 8.5 | 536 | 14–187 | 37 | |
| 8.4 | 536 | 14–187 | 37 | 6 fewer instructions than PHP 8.3 |
| 8.3 | 542 | 14–193 | 37 | |
| 8.2 | 542 | 14–193 | 37 | 1 more instruction than PHP 8.1 |
| 8.1 | 541 | 14–193 | 37 | 1 fewer instruction than PHP 7.4 |
| 7.4 | 542 | 14–193 | 37 |
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
- esc_attr()Escaping for HTML attributes.
- checked()Outputs the HTML checked attribute.
- esc_html()Escaping for HTML blocks.
- selected()Outputs the HTML selected attribute.
- esc_textarea()Escaping for textarea values.
- __()Retrieves the translation of $text.
- wp_dropdown_pages()Retrieves or displays a list of pages as a dropdown (select list).
- current_user_can()Returns whether the current user has the specified capability.
- get_post()Retrieves post data given a post ID or post object.
- get_post_type_object()Retrieves a post type object by name.
- _e()Displays translated text.
- WP_Customize_Control::value()Fetches a setting's value.
Show all 15
- WP_Customize_Control::link()Renders the data link attribute for the control's input element.
- WP_Customize_Control::input_attrs()Renders the custom attributes for the control's input element.
- WP_Customize_Control::get_link()Gets the data link attribute for a setting.
Used by · 1
- WP_Customize_Control::render()Renders the control wrapper and calls $this->render_content() for the internals.
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': if ( ! array_key_exists( 'rows', $this->input_attrs ) ) { $this->input_attrs['rows'] = 5; } ?>Changelog
Introduced in 3.4.0. Unchanged from 6.7.7 through 7.1.0.
Signature, return type and hooks compared across 5 parsed releases.
About this page
- Parsed data
- Generated from the wordpress-develop 7.1.0 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.