attachment_submitbox_metadata()
- Since
- 3.5.0
- Source
wp-admin/includes/media.php:3333
Compatibility
- WordPress
- since 3.5.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 attachment_submitbox_metadata() 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
- 128–222
- Plugin surface
- 3 hooks
- Called by
- 0
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 414.
Third-party callbacks on 'media_meta', 'media_submitbox_misc_sections', 'audio_submitbox_misc_sections' run inside this call, and their cost is not bounded by anything here.
Nothing in core calls this; the cost is only what you spend yourself.
What it touches
- querycontent query
get_post()called directly - hookthird-party callbacks
apply_filters()called directly
Further down the call graph this can also reach option, 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 · 48 distinct outcomes
One number would be a lie: the work depends on which branch runs. These are every distinct cost attachment_submitbox_metadata() can have, taken from its control-flow graph on PHP 8.5.
| When | Instructions | Calls it makes |
|---|---|---|
!isset($meta) && !->exists() && !$post && !preg_match() && empty($file_size) && empty($meta) | 128–137 | get_post(), get_attached_file(), wp_basename(), esc_html(), wp_get_attachment_metadata(), apply_filters(), wp_get_attachment_url(), __(), ->exists(), _e(), _e(), esc_attr(), _e(), _e(), esc_url(), _e(), _e(), _e(), get_attached_file(), preg_match(), strtoupper() |
!isset($meta) && !->exists() && !$post && !preg_match() && is_string($file) && $file !== "" && !is_readable() && empty($file_size) && empty($meta) | 134–141 | get_post(), get_attached_file(), wp_basename(), esc_html(), wp_get_attachment_metadata(), apply_filters(), wp_get_attachment_url(), __(), ->exists(), _e(), _e(), esc_attr(), _e(), _e(), esc_url(), _e(), _e(), _e(), get_attached_file(), preg_match(), strtoupper(), is_readable() |
!isset($meta) && !->exists() && !$post && !preg_match() && empty($file_size) && empty($meta) | 135–144 | get_post(), get_attached_file(), wp_basename(), esc_html(), wp_get_attachment_metadata(), apply_filters(), wp_get_attachment_url(), __(), ->exists(), _e(), _e(), esc_attr(), _e(), _e(), esc_url(), _e(), _e(), _e(), get_attached_file(), preg_match(), strtoupper(), _e() |
!isset($meta) && !->exists() && !$post && !preg_match() && !empty($file_size) && empty($meta) | 138–147 | get_post(), get_attached_file(), wp_basename(), esc_html(), wp_get_attachment_metadata(), apply_filters(), wp_get_attachment_url(), __(), ->exists(), _e(), _e(), esc_attr(), _e(), _e(), esc_url(), _e(), _e(), _e(), get_attached_file(), preg_match(), strtoupper(), _e(), size_format() |
!isset($meta) && !->exists() && !$post && !preg_match() && is_string($file) && $file !== "" && is_readable() && empty($file_size) && empty($meta) | 138–145 | get_post(), get_attached_file(), wp_basename(), esc_html(), wp_get_attachment_metadata(), apply_filters(), wp_get_attachment_url(), __(), ->exists(), _e(), _e(), esc_attr(), _e(), _e(), esc_url(), _e(), _e(), _e(), get_attached_file(), preg_match(), strtoupper(), is_readable(), wp_filesize() |
!isset($meta) && !->exists() && !$post && !preg_match() && is_string($file) && $file !== "" && !is_readable() && empty($file_size) && empty($meta) | 141–148 | get_post(), get_attached_file(), wp_basename(), esc_html(), wp_get_attachment_metadata(), apply_filters(), wp_get_attachment_url(), __(), ->exists(), _e(), _e(), esc_attr(), _e(), _e(), esc_url(), _e(), _e(), _e(), get_attached_file(), preg_match(), strtoupper(), is_readable(), _e() |
!isset($meta) && !->exists() && !$post && !preg_match() && is_string($file) && $file !== "" && !is_readable() && !empty($file_size) && empty($meta) | 144–151 | get_post(), get_attached_file(), wp_basename(), esc_html(), wp_get_attachment_metadata(), apply_filters(), wp_get_attachment_url(), __(), ->exists(), _e(), _e(), esc_attr(), _e(), _e(), esc_url(), _e(), _e(), _e(), get_attached_file(), preg_match(), strtoupper(), is_readable(), _e(), size_format() |
!isset($meta) && !->exists() && !$post && !preg_match() && !empty($file_size) && empty($meta) | 145–154 | get_post(), get_attached_file(), wp_basename(), esc_html(), wp_get_attachment_metadata(), apply_filters(), wp_get_attachment_url(), __(), ->exists(), _e(), _e(), esc_attr(), _e(), _e(), esc_url(), _e(), _e(), _e(), get_attached_file(), preg_match(), strtoupper(), _e(), size_format(), _e() |
!isset($meta) && !->exists() && !$post && !preg_match() && is_string($file) && $file !== "" && is_readable() && empty($file_size) && empty($meta) | 145–152 | get_post(), get_attached_file(), wp_basename(), esc_html(), wp_get_attachment_metadata(), apply_filters(), wp_get_attachment_url(), __(), ->exists(), _e(), _e(), esc_attr(), _e(), _e(), esc_url(), _e(), _e(), _e(), get_attached_file(), preg_match(), strtoupper(), is_readable(), wp_filesize(), _e() |
!isset($meta) && !->exists() && !$post && !preg_match() && is_string($file) && $file !== "" && is_readable() && !empty($file_size) && empty($meta) | 148–155 | get_post(), get_attached_file(), wp_basename(), esc_html(), wp_get_attachment_metadata(), apply_filters(), wp_get_attachment_url(), __(), ->exists(), _e(), _e(), esc_attr(), _e(), _e(), esc_url(), _e(), _e(), _e(), get_attached_file(), preg_match(), strtoupper(), is_readable(), wp_filesize(), _e(), size_format() |
!isset($meta) && !->exists() && !$post && !preg_match() && is_string($file) && $file !== "" && !is_readable() && !empty($file_size) && empty($meta) | 151–158 | get_post(), get_attached_file(), wp_basename(), esc_html(), wp_get_attachment_metadata(), apply_filters(), wp_get_attachment_url(), __(), ->exists(), _e(), _e(), esc_attr(), _e(), _e(), esc_url(), _e(), _e(), _e(), get_attached_file(), preg_match(), strtoupper(), is_readable(), _e(), size_format(), _e() |
!isset($meta) && !->exists() && !$post && !preg_match() && empty($file_size) && !empty($meta) | 152–161 | get_post(), get_attached_file(), wp_basename(), esc_html(), wp_get_attachment_metadata(), apply_filters(), wp_get_attachment_url(), __(), ->exists(), _e(), _e(), esc_attr(), _e(), _e(), esc_url(), _e(), _e(), _e(), get_attached_file(), preg_match(), strtoupper(), _e(), wp_get_original_image_url(), esc_url(), wp_get_original_image_path(), wp_basename(), esc_html() |
36 further outcomes, up to 222 instructions
!isset($meta) && !->exists() && !$post && !preg_match() && is_string($file) && $file !== "" && is_readable() && !empty($file_size) && empty($meta) | 155–162 | get_post(), get_attached_file(), wp_basename(), esc_html(), wp_get_attachment_metadata(), apply_filters(), wp_get_attachment_url(), __(), ->exists(), _e(), _e(), esc_attr(), _e(), _e(), esc_url(), _e(), _e(), _e(), get_attached_file(), preg_match(), strtoupper(), is_readable(), wp_filesize(), _e(), size_format(), _e() |
!isset($meta) && !->exists() && !$post && !preg_match() && is_string($file) && $file !== "" && !is_readable() && empty($file_size) && !empty($meta) | 158–165 | get_post(), get_attached_file(), wp_basename(), esc_html(), wp_get_attachment_metadata(), apply_filters(), wp_get_attachment_url(), __(), ->exists(), _e(), _e(), esc_attr(), _e(), _e(), esc_url(), _e(), _e(), _e(), get_attached_file(), preg_match(), strtoupper(), is_readable(), _e(), wp_get_original_image_url(), esc_url(), wp_get_original_image_path(), wp_basename(), esc_html() |
!isset($meta) && !->exists() && !$post && !preg_match() && empty($file_size) && !empty($meta) | 159–168 | get_post(), get_attached_file(), wp_basename(), esc_html(), wp_get_attachment_metadata(), apply_filters(), wp_get_attachment_url(), __(), ->exists(), _e(), _e(), esc_attr(), _e(), _e(), esc_url(), _e(), _e(), _e(), get_attached_file(), preg_match(), strtoupper(), _e(), _e(), wp_get_original_image_url(), esc_url(), wp_get_original_image_path(), wp_basename(), esc_html() |
!isset($meta) && !->exists() && !$post && !preg_match() && empty($file_size) && empty($meta) | 162–173 | get_post(), get_attached_file(), wp_basename(), esc_html(), wp_get_attachment_metadata(), apply_filters(), wp_get_attachment_url(), __(), ->exists(), _e(), _e(), esc_attr(), _e(), _e(), esc_url(), _e(), _e(), _e(), get_attached_file(), preg_match(), strtoupper(), __(), __(), apply_filters(), __(), __(), apply_filters() |
!isset($meta) && !->exists() && !$post && !preg_match() && !empty($file_size) && !empty($meta) | 162–171 | get_post(), get_attached_file(), wp_basename(), esc_html(), wp_get_attachment_metadata(), apply_filters(), wp_get_attachment_url(), __(), ->exists(), _e(), _e(), esc_attr(), _e(), _e(), esc_url(), _e(), _e(), _e(), get_attached_file(), preg_match(), strtoupper(), _e(), size_format(), _e(), wp_get_original_image_url(), esc_url(), wp_get_original_image_path(), wp_basename(), esc_html() |
!isset($meta) && !->exists() && !$post && !preg_match() && is_string($file) && $file !== "" && is_readable() && empty($file_size) && !empty($meta) | 162–169 | get_post(), get_attached_file(), wp_basename(), esc_html(), wp_get_attachment_metadata(), apply_filters(), wp_get_attachment_url(), __(), ->exists(), _e(), _e(), esc_attr(), _e(), _e(), esc_url(), _e(), _e(), _e(), get_attached_file(), preg_match(), strtoupper(), is_readable(), wp_filesize(), _e(), wp_get_original_image_url(), esc_url(), wp_get_original_image_path(), wp_basename(), esc_html() |
!isset($meta) && !->exists() && !$post && !preg_match() && is_string($file) && $file !== "" && !is_readable() && empty($file_size) && !empty($meta) | 165–172 | get_post(), get_attached_file(), wp_basename(), esc_html(), wp_get_attachment_metadata(), apply_filters(), wp_get_attachment_url(), __(), ->exists(), _e(), _e(), esc_attr(), _e(), _e(), esc_url(), _e(), _e(), _e(), get_attached_file(), preg_match(), strtoupper(), is_readable(), _e(), _e(), wp_get_original_image_url(), esc_url(), wp_get_original_image_path(), wp_basename(), esc_html() |
!isset($meta) && !->exists() && !$post && !preg_match() && is_string($file) && $file !== "" && !is_readable() && empty($file_size) && empty($meta) | 168–177 | get_post(), get_attached_file(), wp_basename(), esc_html(), wp_get_attachment_metadata(), apply_filters(), wp_get_attachment_url(), __(), ->exists(), _e(), _e(), esc_attr(), _e(), _e(), esc_url(), _e(), _e(), _e(), get_attached_file(), preg_match(), strtoupper(), is_readable(), __(), __(), apply_filters(), __(), __(), apply_filters() |
!isset($meta) && !->exists() && !$post && !preg_match() && is_string($file) && $file !== "" && !is_readable() && !empty($file_size) && !empty($meta) | 168–175 | get_post(), get_attached_file(), wp_basename(), esc_html(), wp_get_attachment_metadata(), apply_filters(), wp_get_attachment_url(), __(), ->exists(), _e(), _e(), esc_attr(), _e(), _e(), esc_url(), _e(), _e(), _e(), get_attached_file(), preg_match(), strtoupper(), is_readable(), _e(), size_format(), _e(), wp_get_original_image_url(), esc_url(), wp_get_original_image_path(), wp_basename(), esc_html() |
!isset($meta) && !->exists() && !$post && !preg_match() && empty($file_size) && empty($meta) | 169–180 | get_post(), get_attached_file(), wp_basename(), esc_html(), wp_get_attachment_metadata(), apply_filters(), wp_get_attachment_url(), __(), ->exists(), _e(), _e(), esc_attr(), _e(), _e(), esc_url(), _e(), _e(), _e(), get_attached_file(), preg_match(), strtoupper(), __(), __(), apply_filters(), __(), __(), apply_filters(), _e() |
!isset($meta) && !->exists() && !$post && !preg_match() && !empty($file_size) && !empty($meta) | 169–178 | get_post(), get_attached_file(), wp_basename(), esc_html(), wp_get_attachment_metadata(), apply_filters(), wp_get_attachment_url(), __(), ->exists(), _e(), _e(), esc_attr(), _e(), _e(), esc_url(), _e(), _e(), _e(), get_attached_file(), preg_match(), strtoupper(), _e(), size_format(), _e(), _e(), wp_get_original_image_url(), esc_url(), wp_get_original_image_path(), wp_basename(), esc_html() |
!isset($meta) && !->exists() && !$post && !preg_match() && is_string($file) && $file !== "" && is_readable() && empty($file_size) && !empty($meta) | 169–176 | get_post(), get_attached_file(), wp_basename(), esc_html(), wp_get_attachment_metadata(), apply_filters(), wp_get_attachment_url(), __(), ->exists(), _e(), _e(), esc_attr(), _e(), _e(), esc_url(), _e(), _e(), _e(), get_attached_file(), preg_match(), strtoupper(), is_readable(), wp_filesize(), _e(), _e(), wp_get_original_image_url(), esc_url(), wp_get_original_image_path(), wp_basename(), esc_html() |
!isset($meta) && !->exists() && !$post && !preg_match() && !empty($file_size) && empty($meta) | 172–183 | get_post(), get_attached_file(), wp_basename(), esc_html(), wp_get_attachment_metadata(), apply_filters(), wp_get_attachment_url(), __(), ->exists(), _e(), _e(), esc_attr(), _e(), _e(), esc_url(), _e(), _e(), _e(), get_attached_file(), preg_match(), strtoupper(), _e(), size_format(), __(), __(), apply_filters(), __(), __(), apply_filters() |
!isset($meta) && !->exists() && !$post && !preg_match() && is_string($file) && $file !== "" && is_readable() && empty($file_size) && empty($meta) | 172–181 | get_post(), get_attached_file(), wp_basename(), esc_html(), wp_get_attachment_metadata(), apply_filters(), wp_get_attachment_url(), __(), ->exists(), _e(), _e(), esc_attr(), _e(), _e(), esc_url(), _e(), _e(), _e(), get_attached_file(), preg_match(), strtoupper(), is_readable(), wp_filesize(), __(), __(), apply_filters(), __(), __(), apply_filters() |
!isset($meta) && !->exists() && !$post && !preg_match() && is_string($file) && $file !== "" && is_readable() && !empty($file_size) && !empty($meta) | 172–179 | get_post(), get_attached_file(), wp_basename(), esc_html(), wp_get_attachment_metadata(), apply_filters(), wp_get_attachment_url(), __(), ->exists(), _e(), _e(), esc_attr(), _e(), _e(), esc_url(), _e(), _e(), _e(), get_attached_file(), preg_match(), strtoupper(), is_readable(), wp_filesize(), _e(), size_format(), _e(), wp_get_original_image_url(), esc_url(), wp_get_original_image_path(), wp_basename(), esc_html() |
!isset($meta) && !->exists() && !$post && !preg_match() && is_string($file) && $file !== "" && !is_readable() && empty($file_size) && empty($meta) | 175–184 | get_post(), get_attached_file(), wp_basename(), esc_html(), wp_get_attachment_metadata(), apply_filters(), wp_get_attachment_url(), __(), ->exists(), _e(), _e(), esc_attr(), _e(), _e(), esc_url(), _e(), _e(), _e(), get_attached_file(), preg_match(), strtoupper(), is_readable(), __(), __(), apply_filters(), __(), __(), apply_filters(), _e() |
!isset($meta) && !->exists() && !$post && !preg_match() && is_string($file) && $file !== "" && !is_readable() && !empty($file_size) && !empty($meta) | 175–182 | get_post(), get_attached_file(), wp_basename(), esc_html(), wp_get_attachment_metadata(), apply_filters(), wp_get_attachment_url(), __(), ->exists(), _e(), _e(), esc_attr(), _e(), _e(), esc_url(), _e(), _e(), _e(), get_attached_file(), preg_match(), strtoupper(), is_readable(), _e(), size_format(), _e(), _e(), wp_get_original_image_url(), esc_url(), wp_get_original_image_path(), wp_basename(), esc_html() |
!isset($meta) && !->exists() && !$post && !preg_match() && is_string($file) && $file !== "" && !is_readable() && !empty($file_size) && empty($meta) | 178–187 | get_post(), get_attached_file(), wp_basename(), esc_html(), wp_get_attachment_metadata(), apply_filters(), wp_get_attachment_url(), __(), ->exists(), _e(), _e(), esc_attr(), _e(), _e(), esc_url(), _e(), _e(), _e(), get_attached_file(), preg_match(), strtoupper(), is_readable(), _e(), size_format(), __(), __(), apply_filters(), __(), __(), apply_filters() |
!isset($meta) && !->exists() && !$post && !preg_match() && !empty($file_size) && empty($meta) | 179–190 | get_post(), get_attached_file(), wp_basename(), esc_html(), wp_get_attachment_metadata(), apply_filters(), wp_get_attachment_url(), __(), ->exists(), _e(), _e(), esc_attr(), _e(), _e(), esc_url(), _e(), _e(), _e(), get_attached_file(), preg_match(), strtoupper(), _e(), size_format(), __(), __(), apply_filters(), __(), __(), apply_filters(), _e() |
!isset($meta) && !->exists() && !$post && !preg_match() && is_string($file) && $file !== "" && is_readable() && empty($file_size) && empty($meta) | 179–188 | get_post(), get_attached_file(), wp_basename(), esc_html(), wp_get_attachment_metadata(), apply_filters(), wp_get_attachment_url(), __(), ->exists(), _e(), _e(), esc_attr(), _e(), _e(), esc_url(), _e(), _e(), _e(), get_attached_file(), preg_match(), strtoupper(), is_readable(), wp_filesize(), __(), __(), apply_filters(), __(), __(), apply_filters(), _e() |
!isset($meta) && !->exists() && !$post && !preg_match() && is_string($file) && $file !== "" && is_readable() && !empty($file_size) && !empty($meta) | 179–186 | get_post(), get_attached_file(), wp_basename(), esc_html(), wp_get_attachment_metadata(), apply_filters(), wp_get_attachment_url(), __(), ->exists(), _e(), _e(), esc_attr(), _e(), _e(), esc_url(), _e(), _e(), _e(), get_attached_file(), preg_match(), strtoupper(), is_readable(), wp_filesize(), _e(), size_format(), _e(), _e(), wp_get_original_image_url(), esc_url(), wp_get_original_image_path(), wp_basename(), esc_html() |
!isset($meta) && !->exists() && !$post && !preg_match() && is_string($file) && $file !== "" && is_readable() && !empty($file_size) && empty($meta) | 182–191 | get_post(), get_attached_file(), wp_basename(), esc_html(), wp_get_attachment_metadata(), apply_filters(), wp_get_attachment_url(), __(), ->exists(), _e(), _e(), esc_attr(), _e(), _e(), esc_url(), _e(), _e(), _e(), get_attached_file(), preg_match(), strtoupper(), is_readable(), wp_filesize(), _e(), size_format(), __(), __(), apply_filters(), __(), __(), apply_filters() |
!isset($meta) && !->exists() && !$post && !preg_match() && is_string($file) && $file !== "" && !is_readable() && !empty($file_size) && empty($meta) | 185–194 | get_post(), get_attached_file(), wp_basename(), esc_html(), wp_get_attachment_metadata(), apply_filters(), wp_get_attachment_url(), __(), ->exists(), _e(), _e(), esc_attr(), _e(), _e(), esc_url(), _e(), _e(), _e(), get_attached_file(), preg_match(), strtoupper(), is_readable(), _e(), size_format(), __(), __(), apply_filters(), __(), __(), apply_filters(), _e() |
!isset($meta) && !->exists() && !$post && !preg_match() && empty($file_size) && !empty($meta) | 186–197 | get_post(), get_attached_file(), wp_basename(), esc_html(), wp_get_attachment_metadata(), apply_filters(), wp_get_attachment_url(), __(), ->exists(), _e(), _e(), esc_attr(), _e(), _e(), esc_url(), _e(), _e(), _e(), get_attached_file(), preg_match(), strtoupper(), __(), __(), apply_filters(), __(), __(), apply_filters(), _e(), wp_get_original_image_url(), esc_url(), wp_get_original_image_path(), wp_basename(), esc_html() |
!isset($meta) && !->exists() && !$post && !preg_match() && is_string($file) && $file !== "" && is_readable() && !empty($file_size) && empty($meta) | 189–198 | get_post(), get_attached_file(), wp_basename(), esc_html(), wp_get_attachment_metadata(), apply_filters(), wp_get_attachment_url(), __(), ->exists(), _e(), _e(), esc_attr(), _e(), _e(), esc_url(), _e(), _e(), _e(), get_attached_file(), preg_match(), strtoupper(), is_readable(), wp_filesize(), _e(), size_format(), __(), __(), apply_filters(), __(), __(), apply_filters(), _e() |
!isset($meta) && !->exists() && !$post && !preg_match() && is_string($file) && $file !== "" && !is_readable() && empty($file_size) && !empty($meta) | 192–201 | get_post(), get_attached_file(), wp_basename(), esc_html(), wp_get_attachment_metadata(), apply_filters(), wp_get_attachment_url(), __(), ->exists(), _e(), _e(), esc_attr(), _e(), _e(), esc_url(), _e(), _e(), _e(), get_attached_file(), preg_match(), strtoupper(), is_readable(), __(), __(), apply_filters(), __(), __(), apply_filters(), _e(), wp_get_original_image_url(), esc_url(), wp_get_original_image_path(), wp_basename(), esc_html() |
!isset($meta) && !->exists() && !$post && !preg_match() && empty($file_size) && !empty($meta) | 193–204 | get_post(), get_attached_file(), wp_basename(), esc_html(), wp_get_attachment_metadata(), apply_filters(), wp_get_attachment_url(), __(), ->exists(), _e(), _e(), esc_attr(), _e(), _e(), esc_url(), _e(), _e(), _e(), get_attached_file(), preg_match(), strtoupper(), __(), __(), apply_filters(), __(), __(), apply_filters(), _e(), _e(), wp_get_original_image_url(), esc_url(), wp_get_original_image_path(), wp_basename(), esc_html() |
!isset($meta) && !->exists() && !$post && !preg_match() && !empty($file_size) && !empty($meta) | 196–207 | get_post(), get_attached_file(), wp_basename(), esc_html(), wp_get_attachment_metadata(), apply_filters(), wp_get_attachment_url(), __(), ->exists(), _e(), _e(), esc_attr(), _e(), _e(), esc_url(), _e(), _e(), _e(), get_attached_file(), preg_match(), strtoupper(), _e(), size_format(), __(), __(), apply_filters(), __(), __(), apply_filters(), _e(), wp_get_original_image_url(), esc_url(), wp_get_original_image_path(), wp_basename(), esc_html() |
!isset($meta) && !->exists() && !$post && !preg_match() && is_string($file) && $file !== "" && is_readable() && empty($file_size) && !empty($meta) | 196–205 | get_post(), get_attached_file(), wp_basename(), esc_html(), wp_get_attachment_metadata(), apply_filters(), wp_get_attachment_url(), __(), ->exists(), _e(), _e(), esc_attr(), _e(), _e(), esc_url(), _e(), _e(), _e(), get_attached_file(), preg_match(), strtoupper(), is_readable(), wp_filesize(), __(), __(), apply_filters(), __(), __(), apply_filters(), _e(), wp_get_original_image_url(), esc_url(), wp_get_original_image_path(), wp_basename(), esc_html() |
!isset($meta) && !->exists() && !$post && !preg_match() && is_string($file) && $file !== "" && !is_readable() && empty($file_size) && !empty($meta) | 199–208 | get_post(), get_attached_file(), wp_basename(), esc_html(), wp_get_attachment_metadata(), apply_filters(), wp_get_attachment_url(), __(), ->exists(), _e(), _e(), esc_attr(), _e(), _e(), esc_url(), _e(), _e(), _e(), get_attached_file(), preg_match(), strtoupper(), is_readable(), __(), __(), apply_filters(), __(), __(), apply_filters(), _e(), _e(), wp_get_original_image_url(), esc_url(), wp_get_original_image_path(), wp_basename(), esc_html() |
!isset($meta) && !->exists() && !$post && !preg_match() && is_string($file) && $file !== "" && !is_readable() && !empty($file_size) && !empty($meta) | 202–211 | get_post(), get_attached_file(), wp_basename(), esc_html(), wp_get_attachment_metadata(), apply_filters(), wp_get_attachment_url(), __(), ->exists(), _e(), _e(), esc_attr(), _e(), _e(), esc_url(), _e(), _e(), _e(), get_attached_file(), preg_match(), strtoupper(), is_readable(), _e(), size_format(), __(), __(), apply_filters(), __(), __(), apply_filters(), _e(), wp_get_original_image_url(), esc_url(), wp_get_original_image_path(), wp_basename(), esc_html() |
!isset($meta) && !->exists() && !$post && !preg_match() && !empty($file_size) && !empty($meta) | 203–214 | get_post(), get_attached_file(), wp_basename(), esc_html(), wp_get_attachment_metadata(), apply_filters(), wp_get_attachment_url(), __(), ->exists(), _e(), _e(), esc_attr(), _e(), _e(), esc_url(), _e(), _e(), _e(), get_attached_file(), preg_match(), strtoupper(), _e(), size_format(), __(), __(), apply_filters(), __(), __(), apply_filters(), _e(), _e(), wp_get_original_image_url(), esc_url(), wp_get_original_image_path(), wp_basename(), esc_html() |
!isset($meta) && !->exists() && !$post && !preg_match() && is_string($file) && $file !== "" && is_readable() && empty($file_size) && !empty($meta) | 203–212 | get_post(), get_attached_file(), wp_basename(), esc_html(), wp_get_attachment_metadata(), apply_filters(), wp_get_attachment_url(), __(), ->exists(), _e(), _e(), esc_attr(), _e(), _e(), esc_url(), _e(), _e(), _e(), get_attached_file(), preg_match(), strtoupper(), is_readable(), wp_filesize(), __(), __(), apply_filters(), __(), __(), apply_filters(), _e(), _e(), wp_get_original_image_url(), esc_url(), wp_get_original_image_path(), wp_basename(), esc_html() |
!isset($meta) && !->exists() && !$post && !preg_match() && is_string($file) && $file !== "" && is_readable() && !empty($file_size) && !empty($meta) | 206–215 | get_post(), get_attached_file(), wp_basename(), esc_html(), wp_get_attachment_metadata(), apply_filters(), wp_get_attachment_url(), __(), ->exists(), _e(), _e(), esc_attr(), _e(), _e(), esc_url(), _e(), _e(), _e(), get_attached_file(), preg_match(), strtoupper(), is_readable(), wp_filesize(), _e(), size_format(), __(), __(), apply_filters(), __(), __(), apply_filters(), _e(), wp_get_original_image_url(), esc_url(), wp_get_original_image_path(), wp_basename(), esc_html() |
!isset($meta) && !->exists() && !$post && !preg_match() && is_string($file) && $file !== "" && !is_readable() && !empty($file_size) && !empty($meta) | 209–218 | get_post(), get_attached_file(), wp_basename(), esc_html(), wp_get_attachment_metadata(), apply_filters(), wp_get_attachment_url(), __(), ->exists(), _e(), _e(), esc_attr(), _e(), _e(), esc_url(), _e(), _e(), _e(), get_attached_file(), preg_match(), strtoupper(), is_readable(), _e(), size_format(), __(), __(), apply_filters(), __(), __(), apply_filters(), _e(), _e(), wp_get_original_image_url(), esc_url(), wp_get_original_image_path(), wp_basename(), esc_html() |
!isset($meta) && !->exists() && !$post && !preg_match() && is_string($file) && $file !== "" && is_readable() && !empty($file_size) && !empty($meta) | 213–222 | get_post(), get_attached_file(), wp_basename(), esc_html(), wp_get_attachment_metadata(), apply_filters(), wp_get_attachment_url(), __(), ->exists(), _e(), _e(), esc_attr(), _e(), _e(), esc_url(), _e(), _e(), _e(), get_attached_file(), preg_match(), strtoupper(), is_readable(), wp_filesize(), _e(), size_format(), __(), __(), apply_filters(), __(), __(), apply_filters(), _e(), _e(), wp_get_original_image_url(), esc_url(), wp_get_original_image_path(), wp_basename(), esc_html() |
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 | 413 | 128–222 | 33 | 1 fewer instruction than PHP 8.5 |
| 8.5 | 414 | 128–222 | 33 | |
| 8.4 | 414 | 128–222 | 33 | 8 fewer instructions than PHP 8.3 |
| 8.3 | 422 | 134–230 | 33 | |
| 8.2 | 422 | 134–230 | 33 | 1 more instruction than PHP 8.1 |
| 8.1 | 421 | 134–230 | 33 | 3 fewer instructions than PHP 7.4 |
| 7.4 | 424 | 134–230 | 33 |
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.
Hooks and filters fired · 3
3 hooks fire while attachment_submitbox_metadata() runs, in this order:
- apply_filters( media_submitbox_misc_sections )filterline 3460 (+127 into the body)
Filters the audio and video metadata fields to be shown in the publish meta box.
- apply_filters( audio_submitbox_misc_sections )filterline 3511 (+178 into the body)
Filters the audio attachment metadata fields to be shown in the publish meta box.
Uses · 20
- get_post()Retrieves post data given a post ID or post object.
- get_attached_file()Retrieves attached file path based on attachment ID.
- esc_html()Escaping for HTML blocks.
- wp_basename()i18n-friendly version of basename().
- wp_get_attachment_metadata()Retrieves attachment metadata for attachment ID.
- __()Retrieves the translation of $text.
- apply_filters()Calls the callback functions that have been added to a filter hook.
- wp_get_attachment_url()Retrieves the URL for an attachment.
- get_edit_user_link()Retrieves the edit user link.
- _e()Displays translated text.
- get_edit_post_link()Retrieves the edit post link for post.
- esc_attr()Escaping for HTML attributes.
Show all 20
- esc_url()Checks and cleans a URL.
- wp_filesize()Wrapper for PHP filesize with filters and casting the result as an integer.
- size_format()Converts a number of bytes to the largest unit the bytes will fit into.
- sanitize_html_class()Sanitizes an HTML classname to ensure it only contains valid characters.
- human_readable_duration()Converts a duration to human readable format.
- wp_get_original_image_url()Retrieves the URL to an original attachment image.
- wp_get_original_image_path()Retrieves the path to an uploaded image file.
- WP_User::__construct()Constructor.
Source code
function attachment_submitbox_metadata() { $post = get_post(); $attachment_id = $post->ID; $file = get_attached_file( $attachment_id ); $filename = esc_html( wp_basename( $file ) ); $media_dims = ''; $meta = wp_get_attachment_metadata( $attachment_id ); if ( isset( $meta['width'], $meta['height'] ) ) { /* translators: 1: A number of pixels wide, 2: A number of pixels tall. */ $media_dims .= "<span id='media-dims-$attachment_id'>" . sprintf( __( '%1$s by %2$s pixels' ), $meta['width'], $meta['height'] ) . '</span>'; } /** This filter is documented in wp-admin/includes/media.php */ $media_dims = apply_filters( 'media_meta', $media_dims, $post ); $att_url = wp_get_attachment_url( $attachment_id ); $author = new WP_User( $post->post_author ); $uploaded_by_name = __( '(no author)' ); $uploaded_by_link = ''; if ( $author->exists() ) { $uploaded_by_name = $author->display_name ? $author->display_name : $author->nickname; $uploaded_by_link = get_edit_user_link( $author->ID ); } ?> <div class="misc-pub-section misc-pub-uploadedby word-wrap-break-word"> <?php if ( $uploaded_by_link ) { ?> <?php _e( 'Uploaded by:' ); ?> <a href="<?php echo $uploaded_by_link; ?>"><strong><?php echo $uploaded_by_name; ?></strong></a> <?php } else { ?> <?php _e( 'Uploaded by:' ); ?> <strong><?php echo $uploaded_by_name; ?></strong> <?php } ?> </div> <?php if ( $post->post_parent ) { $post_parent = get_post( $post->post_parent ); if ( $post_parent ) { $uploaded_to_title = $post_parent->post_title ? $post_parent->post_title : __( '(no title)' ); $uploaded_to_link = get_edit_post_link( $post->post_parent, 'raw' ); ?> <div class="misc-pub-section misc-pub-uploadedto"> <?php if ( $uploaded_to_link ) { ?> <?php _e( 'Uploaded to:' ); ?> <a href="<?php echo $uploaded_to_link; ?>"><strong><?php echo $uploaded_to_title; ?></strong></a> <?php } else { ?> <?php _e( 'Uploaded to:' ); ?> <strong><?php echo $uploaded_to_title; ?></strong> <?php } ?> </div> <?php } } ?> <div class="misc-pub-section misc-pub-attachment"> <label for="attachment_url"><?php _e( 'File URL:' ); ?></label> <input type="text" class="widefat urlfield ltr" readonly="readonly" name="attachment_url" id="attachment_url" value="<?php echo esc_attr( $att_url ); ?>" /> <span class="copy-to-clipboard-container"> <button type="button" class="button copy-attachment-url edit-media" data-clipboard-target="#attachment_url"><?php _e( 'Copy URL to clipboard' ); ?></button> <span class="success hidden" aria-hidden="true"><?php _e( 'Copied!' ); ?></span> </span> </div> <div class="misc-pub-section misc-pub-download"> <a href="<?php echo esc_url( $att_url ); ?>" download><?php _e( 'Download file' ); ?></a> </div> <div class="misc-pub-section misc-pub-filename"> <?php _e( 'File name:' ); ?> <strong><?php echo $filename; ?></strong> </div> <div class="misc-pub-section misc-pub-filetype"> <?php _e( 'File type:' ); ?> <strong> <?php if ( preg_match( '/^.*?\.(\w+)$/', get_attached_file( $post->ID ), $matches ) ) { echo esc_html( strtoupper( $matches[1] ) ); list( $mime_type ) = explode( '/', $post->post_mime_type ); if ( 'image' !== $mime_type && ! empty( $meta['mime_type'] ) ) { if ( "$mime_type/" . strtolower( $matches[1] ) !== $meta['mime_type'] ) {Changelog
Introduced in 3.5.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-admin/includes/media.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.