wppaste
WordPress

render_block_core_media_text( array $attributes, string $content ): string

Since
6.6.0
Source
wp-includes/blocks/media-text.php:18
Renders the core/media-text block on server.

Compatibility

WordPress
since 6.6.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.

Parameters

$attributesarray
The block attributes.
$contentstring
The block rendered content.

Return value

string
Returns the Media & Text block markup, if useFeaturedImage is true.

Performance profile

How much work a call to render_block_core_media_text() 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 what you pass in.

Instructions
6–155

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

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 it touches

  • hookthird-party callbacksapply_filters()one call below render_block_core_media_text()
  • querycontent queryget_post()one call below render_block_core_media_text()

Further down the call graph this can also reach cache, serialize, option 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 · 67 distinct outcomes

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

WhenInstructionsCalls it makes
always6none
!in_the_loop()13in_the_loop(), get_the_post_thumbnail_url()
in_the_loop()15in_the_loop(), update_post_thumbnail_cache(), get_the_post_thumbnail_url()
!in_the_loop() && !isset($attributes) && !->next_tag() && !figure()74–77in_the_loop(), get_the_post_thumbnail_url(), wp_unique_id(), ->next_tag(), ->get_updated_html(), ->next_tag(), ->get_updated_html(), preg_quote(), figure()
in_the_loop() && !isset($attributes) && !->next_tag() && !figure()76–79in_the_loop(), update_post_thumbnail_cache(), get_the_post_thumbnail_url(), wp_unique_id(), ->next_tag(), ->get_updated_html(), ->next_tag(), ->get_updated_html(), preg_quote(), figure()
!in_the_loop() && !isset($attributes) && !figure()78–81in_the_loop(), get_the_post_thumbnail_url(), wp_unique_id(), ->next_tag(), ->get_updated_html(), ->next_tag(), ->set_attribute(), ->get_updated_html(), preg_quote(), figure()
!in_the_loop() && !isset($attributes) && !->next_tag() && !->has_bookmark() && !figure()79–82in_the_loop(), get_the_post_thumbnail_url(), wp_unique_id(), ->next_tag(), ->get_updated_html(), ->next_tag(), ->has_bookmark(), ->get_updated_html(), preg_quote(), figure()
in_the_loop() && !isset($attributes) && !figure()80–83in_the_loop(), update_post_thumbnail_cache(), get_the_post_thumbnail_url(), wp_unique_id(), ->next_tag(), ->get_updated_html(), ->next_tag(), ->set_attribute(), ->get_updated_html(), preg_quote(), figure()
!in_the_loop() && !isset($attributes) && !->next_tag() && figure()81–84in_the_loop(), get_the_post_thumbnail_url(), wp_unique_id(), ->next_tag(), ->get_updated_html(), ->next_tag(), ->get_updated_html(), preg_quote(), figure(), ->remove_attribute(), ->next_tag()
in_the_loop() && !isset($attributes) && !->next_tag() && !->has_bookmark() && !figure()81–84in_the_loop(), update_post_thumbnail_cache(), get_the_post_thumbnail_url(), wp_unique_id(), ->next_tag(), ->get_updated_html(), ->next_tag(), ->has_bookmark(), ->get_updated_html(), preg_quote(), figure()
in_the_loop() && !isset($attributes) && !->next_tag() && figure()83–86in_the_loop(), update_post_thumbnail_cache(), get_the_post_thumbnail_url(), wp_unique_id(), ->next_tag(), ->get_updated_html(), ->next_tag(), ->get_updated_html(), preg_quote(), figure(), ->remove_attribute(), ->next_tag()
!in_the_loop() && !isset($attributes) && figure()85–88in_the_loop(), get_the_post_thumbnail_url(), wp_unique_id(), ->next_tag(), ->get_updated_html(), ->next_tag(), ->set_attribute(), ->get_updated_html(), preg_quote(), figure(), ->remove_attribute(), ->next_tag()
55 further outcomes, up to 155 instructions
!in_the_loop() && !isset($attributes) && !->next_tag() && !->has_bookmark() && figure()86–89in_the_loop(), get_the_post_thumbnail_url(), wp_unique_id(), ->next_tag(), ->get_updated_html(), ->next_tag(), ->has_bookmark(), ->get_updated_html(), preg_quote(), figure(), ->remove_attribute(), ->next_tag()
!in_the_loop() && !isset($attributes) && !->next_tag() && ->has_bookmark() && !figure()87–90in_the_loop(), get_the_post_thumbnail_url(), wp_unique_id(), ->next_tag(), ->get_updated_html(), ->next_tag(), ->has_bookmark(), ->seek(), ->set_attribute(), ->get_updated_html(), preg_quote(), figure()
in_the_loop() && !isset($attributes) && figure()87–90in_the_loop(), update_post_thumbnail_cache(), get_the_post_thumbnail_url(), wp_unique_id(), ->next_tag(), ->get_updated_html(), ->next_tag(), ->set_attribute(), ->get_updated_html(), preg_quote(), figure(), ->remove_attribute(), ->next_tag()
in_the_loop() && !isset($attributes) && !->next_tag() && !->has_bookmark() && figure()88–91in_the_loop(), update_post_thumbnail_cache(), get_the_post_thumbnail_url(), wp_unique_id(), ->next_tag(), ->get_updated_html(), ->next_tag(), ->has_bookmark(), ->get_updated_html(), preg_quote(), figure(), ->remove_attribute(), ->next_tag()
!in_the_loop() && isset($attributes) && !->next_tag() && !figure()89–92in_the_loop(), get_the_post_thumbnail_url(), round(), round(), wp_unique_id(), ->next_tag(), ->get_updated_html(), ->next_tag(), ->get_updated_html(), preg_quote(), figure()
in_the_loop() && !isset($attributes) && !->next_tag() && ->has_bookmark() && !figure()89–92in_the_loop(), update_post_thumbnail_cache(), get_the_post_thumbnail_url(), wp_unique_id(), ->next_tag(), ->get_updated_html(), ->next_tag(), ->has_bookmark(), ->seek(), ->set_attribute(), ->get_updated_html(), preg_quote(), figure()
in_the_loop() && isset($attributes) && !->next_tag() && !figure()91–94in_the_loop(), update_post_thumbnail_cache(), get_the_post_thumbnail_url(), round(), round(), wp_unique_id(), ->next_tag(), ->get_updated_html(), ->next_tag(), ->get_updated_html(), preg_quote(), figure()
!in_the_loop() && isset($attributes) && !figure()93–96in_the_loop(), get_the_post_thumbnail_url(), round(), round(), wp_unique_id(), ->next_tag(), ->get_updated_html(), ->next_tag(), ->set_attribute(), ->get_updated_html(), preg_quote(), figure()
!in_the_loop() && isset($attributes) && !->next_tag() && !->has_bookmark() && !figure()94–97in_the_loop(), get_the_post_thumbnail_url(), round(), round(), wp_unique_id(), ->next_tag(), ->get_updated_html(), ->next_tag(), ->has_bookmark(), ->get_updated_html(), preg_quote(), figure()
!in_the_loop() && !isset($attributes) && !->next_tag() && ->has_bookmark() && figure()94–97in_the_loop(), get_the_post_thumbnail_url(), wp_unique_id(), ->next_tag(), ->get_updated_html(), ->next_tag(), ->has_bookmark(), ->seek(), ->set_attribute(), ->get_updated_html(), preg_quote(), figure(), ->remove_attribute(), ->next_tag()
in_the_loop() && isset($attributes) && !figure()95–98in_the_loop(), update_post_thumbnail_cache(), get_the_post_thumbnail_url(), round(), round(), wp_unique_id(), ->next_tag(), ->get_updated_html(), ->next_tag(), ->set_attribute(), ->get_updated_html(), preg_quote(), figure()
!in_the_loop() && isset($attributes) && !->next_tag() && figure()96–99in_the_loop(), get_the_post_thumbnail_url(), round(), round(), wp_unique_id(), ->next_tag(), ->get_updated_html(), ->next_tag(), ->get_updated_html(), preg_quote(), figure(), ->remove_attribute(), ->next_tag()
in_the_loop() && isset($attributes) && !->next_tag() && !->has_bookmark() && !figure()96–99in_the_loop(), update_post_thumbnail_cache(), get_the_post_thumbnail_url(), round(), round(), wp_unique_id(), ->next_tag(), ->get_updated_html(), ->next_tag(), ->has_bookmark(), ->get_updated_html(), preg_quote(), figure()
in_the_loop() && !isset($attributes) && !->next_tag() && ->has_bookmark() && figure()96–99in_the_loop(), update_post_thumbnail_cache(), get_the_post_thumbnail_url(), wp_unique_id(), ->next_tag(), ->get_updated_html(), ->next_tag(), ->has_bookmark(), ->seek(), ->set_attribute(), ->get_updated_html(), preg_quote(), figure(), ->remove_attribute(), ->next_tag()
in_the_loop() && isset($attributes) && !->next_tag() && figure()98–101in_the_loop(), update_post_thumbnail_cache(), get_the_post_thumbnail_url(), round(), round(), wp_unique_id(), ->next_tag(), ->get_updated_html(), ->next_tag(), ->get_updated_html(), preg_quote(), figure(), ->remove_attribute(), ->next_tag()
!in_the_loop() && isset($attributes) && figure()100–103in_the_loop(), get_the_post_thumbnail_url(), round(), round(), wp_unique_id(), ->next_tag(), ->get_updated_html(), ->next_tag(), ->set_attribute(), ->get_updated_html(), preg_quote(), figure(), ->remove_attribute(), ->next_tag()
!in_the_loop() && isset($attributes) && !->next_tag() && !->has_bookmark() && figure()101–104in_the_loop(), get_the_post_thumbnail_url(), round(), round(), wp_unique_id(), ->next_tag(), ->get_updated_html(), ->next_tag(), ->has_bookmark(), ->get_updated_html(), preg_quote(), figure(), ->remove_attribute(), ->next_tag()
!in_the_loop() && isset($attributes) && !->next_tag() && ->has_bookmark() && !figure()102–105in_the_loop(), get_the_post_thumbnail_url(), round(), round(), wp_unique_id(), ->next_tag(), ->get_updated_html(), ->next_tag(), ->has_bookmark(), ->seek(), ->set_attribute(), ->get_updated_html(), preg_quote(), figure()
in_the_loop() && isset($attributes) && figure()102–105in_the_loop(), update_post_thumbnail_cache(), get_the_post_thumbnail_url(), round(), round(), wp_unique_id(), ->next_tag(), ->get_updated_html(), ->next_tag(), ->set_attribute(), ->get_updated_html(), preg_quote(), figure(), ->remove_attribute(), ->next_tag()
in_the_loop() && isset($attributes) && !->next_tag() && !->has_bookmark() && figure()103–106in_the_loop(), update_post_thumbnail_cache(), get_the_post_thumbnail_url(), round(), round(), wp_unique_id(), ->next_tag(), ->get_updated_html(), ->next_tag(), ->has_bookmark(), ->get_updated_html(), preg_quote(), figure(), ->remove_attribute(), ->next_tag()
in_the_loop() && isset($attributes) && !->next_tag() && ->has_bookmark() && !figure()104–107in_the_loop(), update_post_thumbnail_cache(), get_the_post_thumbnail_url(), round(), round(), wp_unique_id(), ->next_tag(), ->get_updated_html(), ->next_tag(), ->has_bookmark(), ->seek(), ->set_attribute(), ->get_updated_html(), preg_quote(), figure()
!in_the_loop() && isset($attributes) && !->next_tag() && ->has_bookmark() && figure()109–112in_the_loop(), get_the_post_thumbnail_url(), round(), round(), wp_unique_id(), ->next_tag(), ->get_updated_html(), ->next_tag(), ->has_bookmark(), ->seek(), ->set_attribute(), ->get_updated_html(), preg_quote(), figure(), ->remove_attribute(), ->next_tag()
in_the_loop() && isset($attributes) && !->next_tag() && ->has_bookmark() && figure()111–114in_the_loop(), update_post_thumbnail_cache(), get_the_post_thumbnail_url(), round(), round(), wp_unique_id(), ->next_tag(), ->get_updated_html(), ->next_tag(), ->has_bookmark(), ->seek(), ->set_attribute(), ->get_updated_html(), preg_quote(), figure(), ->remove_attribute(), ->next_tag()
!in_the_loop() && !isset($attributes) && figure()116–119in_the_loop(), get_the_post_thumbnail_url(), wp_unique_id(), ->next_tag(), ->get_updated_html(), ->next_tag(), ->get_updated_html(), preg_quote(), figure(), ->remove_attribute(), ->next_tag(), esc_url(), ->set_attribute(), get_post_thumbnail_id(), ->set_attribute(), get_post_thumbnail_id(), get_post_meta(), strip_tags(), ->set_attribute(), ->get_updated_html()
in_the_loop() && !isset($attributes) && figure()118–121in_the_loop(), update_post_thumbnail_cache(), get_the_post_thumbnail_url(), wp_unique_id(), ->next_tag(), ->get_updated_html(), ->next_tag(), ->get_updated_html(), preg_quote(), figure(), ->remove_attribute(), ->next_tag(), esc_url(), ->set_attribute(), get_post_thumbnail_id(), ->set_attribute(), get_post_thumbnail_id(), get_post_meta(), strip_tags(), ->set_attribute(), ->get_updated_html()
!in_the_loop() && !isset($attributes) && figure()120–123in_the_loop(), get_the_post_thumbnail_url(), wp_unique_id(), ->next_tag(), ->get_updated_html(), ->next_tag(), ->set_attribute(), ->get_updated_html(), preg_quote(), figure(), ->remove_attribute(), ->next_tag(), esc_url(), ->set_attribute(), get_post_thumbnail_id(), ->set_attribute(), get_post_thumbnail_id(), get_post_meta(), strip_tags(), ->set_attribute(), ->get_updated_html()
!in_the_loop() && !isset($attributes) && !->has_bookmark() && figure()121–124in_the_loop(), get_the_post_thumbnail_url(), wp_unique_id(), ->next_tag(), ->get_updated_html(), ->next_tag(), ->has_bookmark(), ->get_updated_html(), preg_quote(), figure(), ->remove_attribute(), ->next_tag(), esc_url(), ->set_attribute(), get_post_thumbnail_id(), ->set_attribute(), get_post_thumbnail_id(), get_post_meta(), strip_tags(), ->set_attribute(), ->get_updated_html()
!in_the_loop() && !isset($attributes) && figure()122–125in_the_loop(), get_the_post_thumbnail_url(), wp_unique_id(), ->next_tag(), ->get_updated_html(), ->next_tag(), ->get_updated_html(), preg_quote(), figure(), ->remove_attribute(), ->next_tag(), esc_url(), ->set_attribute(), get_post_thumbnail_id(), ->set_attribute(), get_post_thumbnail_id(), get_post_meta(), strip_tags(), ->set_attribute(), ->set_attribute(), ->get_updated_html()
in_the_loop() && !isset($attributes) && figure()122–125in_the_loop(), update_post_thumbnail_cache(), get_the_post_thumbnail_url(), wp_unique_id(), ->next_tag(), ->get_updated_html(), ->next_tag(), ->set_attribute(), ->get_updated_html(), preg_quote(), figure(), ->remove_attribute(), ->next_tag(), esc_url(), ->set_attribute(), get_post_thumbnail_id(), ->set_attribute(), get_post_thumbnail_id(), get_post_meta(), strip_tags(), ->set_attribute(), ->get_updated_html()
in_the_loop() && !isset($attributes) && !->has_bookmark() && figure()123–126in_the_loop(), update_post_thumbnail_cache(), get_the_post_thumbnail_url(), wp_unique_id(), ->next_tag(), ->get_updated_html(), ->next_tag(), ->has_bookmark(), ->get_updated_html(), preg_quote(), figure(), ->remove_attribute(), ->next_tag(), esc_url(), ->set_attribute(), get_post_thumbnail_id(), ->set_attribute(), get_post_thumbnail_id(), get_post_meta(), strip_tags(), ->set_attribute(), ->get_updated_html()
in_the_loop() && !isset($attributes) && figure()124–127in_the_loop(), update_post_thumbnail_cache(), get_the_post_thumbnail_url(), wp_unique_id(), ->next_tag(), ->get_updated_html(), ->next_tag(), ->get_updated_html(), preg_quote(), figure(), ->remove_attribute(), ->next_tag(), esc_url(), ->set_attribute(), get_post_thumbnail_id(), ->set_attribute(), get_post_thumbnail_id(), get_post_meta(), strip_tags(), ->set_attribute(), ->set_attribute(), ->get_updated_html()
!in_the_loop() && !isset($attributes) && figure()126–129in_the_loop(), get_the_post_thumbnail_url(), wp_unique_id(), ->next_tag(), ->get_updated_html(), ->next_tag(), ->set_attribute(), ->get_updated_html(), preg_quote(), figure(), ->remove_attribute(), ->next_tag(), esc_url(), ->set_attribute(), get_post_thumbnail_id(), ->set_attribute(), get_post_thumbnail_id(), get_post_meta(), strip_tags(), ->set_attribute(), ->set_attribute(), ->get_updated_html()
!in_the_loop() && !isset($attributes) && !->has_bookmark() && figure()127–130in_the_loop(), get_the_post_thumbnail_url(), wp_unique_id(), ->next_tag(), ->get_updated_html(), ->next_tag(), ->has_bookmark(), ->get_updated_html(), preg_quote(), figure(), ->remove_attribute(), ->next_tag(), esc_url(), ->set_attribute(), get_post_thumbnail_id(), ->set_attribute(), get_post_thumbnail_id(), get_post_meta(), strip_tags(), ->set_attribute(), ->set_attribute(), ->get_updated_html()
in_the_loop() && !isset($attributes) && figure()128–131in_the_loop(), update_post_thumbnail_cache(), get_the_post_thumbnail_url(), wp_unique_id(), ->next_tag(), ->get_updated_html(), ->next_tag(), ->set_attribute(), ->get_updated_html(), preg_quote(), figure(), ->remove_attribute(), ->next_tag(), esc_url(), ->set_attribute(), get_post_thumbnail_id(), ->set_attribute(), get_post_thumbnail_id(), get_post_meta(), strip_tags(), ->set_attribute(), ->set_attribute(), ->get_updated_html()
!in_the_loop() && !isset($attributes) && ->has_bookmark() && figure()129–132in_the_loop(), get_the_post_thumbnail_url(), wp_unique_id(), ->next_tag(), ->get_updated_html(), ->next_tag(), ->has_bookmark(), ->seek(), ->set_attribute(), ->get_updated_html(), preg_quote(), figure(), ->remove_attribute(), ->next_tag(), esc_url(), ->set_attribute(), get_post_thumbnail_id(), ->set_attribute(), get_post_thumbnail_id(), get_post_meta(), strip_tags(), ->set_attribute(), ->get_updated_html()
in_the_loop() && !isset($attributes) && !->has_bookmark() && figure()129–132in_the_loop(), update_post_thumbnail_cache(), get_the_post_thumbnail_url(), wp_unique_id(), ->next_tag(), ->get_updated_html(), ->next_tag(), ->has_bookmark(), ->get_updated_html(), preg_quote(), figure(), ->remove_attribute(), ->next_tag(), esc_url(), ->set_attribute(), get_post_thumbnail_id(), ->set_attribute(), get_post_thumbnail_id(), get_post_meta(), strip_tags(), ->set_attribute(), ->set_attribute(), ->get_updated_html()
!in_the_loop() && isset($attributes) && figure()131–134in_the_loop(), get_the_post_thumbnail_url(), round(), round(), wp_unique_id(), ->next_tag(), ->get_updated_html(), ->next_tag(), ->get_updated_html(), preg_quote(), figure(), ->remove_attribute(), ->next_tag(), esc_url(), ->set_attribute(), get_post_thumbnail_id(), ->set_attribute(), get_post_thumbnail_id(), get_post_meta(), strip_tags(), ->set_attribute(), ->get_updated_html()
in_the_loop() && !isset($attributes) && ->has_bookmark() && figure()131–134in_the_loop(), update_post_thumbnail_cache(), get_the_post_thumbnail_url(), wp_unique_id(), ->next_tag(), ->get_updated_html(), ->next_tag(), ->has_bookmark(), ->seek(), ->set_attribute(), ->get_updated_html(), preg_quote(), figure(), ->remove_attribute(), ->next_tag(), esc_url(), ->set_attribute(), get_post_thumbnail_id(), ->set_attribute(), get_post_thumbnail_id(), get_post_meta(), strip_tags(), ->set_attribute(), ->get_updated_html()
in_the_loop() && isset($attributes) && figure()133–136in_the_loop(), update_post_thumbnail_cache(), get_the_post_thumbnail_url(), round(), round(), wp_unique_id(), ->next_tag(), ->get_updated_html(), ->next_tag(), ->get_updated_html(), preg_quote(), figure(), ->remove_attribute(), ->next_tag(), esc_url(), ->set_attribute(), get_post_thumbnail_id(), ->set_attribute(), get_post_thumbnail_id(), get_post_meta(), strip_tags(), ->set_attribute(), ->get_updated_html()
!in_the_loop() && isset($attributes) && figure()135–138in_the_loop(), get_the_post_thumbnail_url(), round(), round(), wp_unique_id(), ->next_tag(), ->get_updated_html(), ->next_tag(), ->set_attribute(), ->get_updated_html(), preg_quote(), figure(), ->remove_attribute(), ->next_tag(), esc_url(), ->set_attribute(), get_post_thumbnail_id(), ->set_attribute(), get_post_thumbnail_id(), get_post_meta(), strip_tags(), ->set_attribute(), ->get_updated_html()
!in_the_loop() && !isset($attributes) && ->has_bookmark() && figure()135–138in_the_loop(), get_the_post_thumbnail_url(), wp_unique_id(), ->next_tag(), ->get_updated_html(), ->next_tag(), ->has_bookmark(), ->seek(), ->set_attribute(), ->get_updated_html(), preg_quote(), figure(), ->remove_attribute(), ->next_tag(), esc_url(), ->set_attribute(), get_post_thumbnail_id(), ->set_attribute(), get_post_thumbnail_id(), get_post_meta(), strip_tags(), ->set_attribute(), ->set_attribute(), ->get_updated_html()
!in_the_loop() && isset($attributes) && !->has_bookmark() && figure()136–139in_the_loop(), get_the_post_thumbnail_url(), round(), round(), wp_unique_id(), ->next_tag(), ->get_updated_html(), ->next_tag(), ->has_bookmark(), ->get_updated_html(), preg_quote(), figure(), ->remove_attribute(), ->next_tag(), esc_url(), ->set_attribute(), get_post_thumbnail_id(), ->set_attribute(), get_post_thumbnail_id(), get_post_meta(), strip_tags(), ->set_attribute(), ->get_updated_html()
!in_the_loop() && isset($attributes) && figure()137–140in_the_loop(), get_the_post_thumbnail_url(), round(), round(), wp_unique_id(), ->next_tag(), ->get_updated_html(), ->next_tag(), ->get_updated_html(), preg_quote(), figure(), ->remove_attribute(), ->next_tag(), esc_url(), ->set_attribute(), get_post_thumbnail_id(), ->set_attribute(), get_post_thumbnail_id(), get_post_meta(), strip_tags(), ->set_attribute(), ->set_attribute(), ->get_updated_html()
in_the_loop() && isset($attributes) && figure()137–140in_the_loop(), update_post_thumbnail_cache(), get_the_post_thumbnail_url(), round(), round(), wp_unique_id(), ->next_tag(), ->get_updated_html(), ->next_tag(), ->set_attribute(), ->get_updated_html(), preg_quote(), figure(), ->remove_attribute(), ->next_tag(), esc_url(), ->set_attribute(), get_post_thumbnail_id(), ->set_attribute(), get_post_thumbnail_id(), get_post_meta(), strip_tags(), ->set_attribute(), ->get_updated_html()
in_the_loop() && !isset($attributes) && ->has_bookmark() && figure()137–140in_the_loop(), update_post_thumbnail_cache(), get_the_post_thumbnail_url(), wp_unique_id(), ->next_tag(), ->get_updated_html(), ->next_tag(), ->has_bookmark(), ->seek(), ->set_attribute(), ->get_updated_html(), preg_quote(), figure(), ->remove_attribute(), ->next_tag(), esc_url(), ->set_attribute(), get_post_thumbnail_id(), ->set_attribute(), get_post_thumbnail_id(), get_post_meta(), strip_tags(), ->set_attribute(), ->set_attribute(), ->get_updated_html()
in_the_loop() && isset($attributes) && !->has_bookmark() && figure()138–141in_the_loop(), update_post_thumbnail_cache(), get_the_post_thumbnail_url(), round(), round(), wp_unique_id(), ->next_tag(), ->get_updated_html(), ->next_tag(), ->has_bookmark(), ->get_updated_html(), preg_quote(), figure(), ->remove_attribute(), ->next_tag(), esc_url(), ->set_attribute(), get_post_thumbnail_id(), ->set_attribute(), get_post_thumbnail_id(), get_post_meta(), strip_tags(), ->set_attribute(), ->get_updated_html()
in_the_loop() && isset($attributes) && figure()139–142in_the_loop(), update_post_thumbnail_cache(), get_the_post_thumbnail_url(), round(), round(), wp_unique_id(), ->next_tag(), ->get_updated_html(), ->next_tag(), ->get_updated_html(), preg_quote(), figure(), ->remove_attribute(), ->next_tag(), esc_url(), ->set_attribute(), get_post_thumbnail_id(), ->set_attribute(), get_post_thumbnail_id(), get_post_meta(), strip_tags(), ->set_attribute(), ->set_attribute(), ->get_updated_html()
!in_the_loop() && isset($attributes) && figure()141–144in_the_loop(), get_the_post_thumbnail_url(), round(), round(), wp_unique_id(), ->next_tag(), ->get_updated_html(), ->next_tag(), ->set_attribute(), ->get_updated_html(), preg_quote(), figure(), ->remove_attribute(), ->next_tag(), esc_url(), ->set_attribute(), get_post_thumbnail_id(), ->set_attribute(), get_post_thumbnail_id(), get_post_meta(), strip_tags(), ->set_attribute(), ->set_attribute(), ->get_updated_html()
!in_the_loop() && isset($attributes) && !->has_bookmark() && figure()142–145in_the_loop(), get_the_post_thumbnail_url(), round(), round(), wp_unique_id(), ->next_tag(), ->get_updated_html(), ->next_tag(), ->has_bookmark(), ->get_updated_html(), preg_quote(), figure(), ->remove_attribute(), ->next_tag(), esc_url(), ->set_attribute(), get_post_thumbnail_id(), ->set_attribute(), get_post_thumbnail_id(), get_post_meta(), strip_tags(), ->set_attribute(), ->set_attribute(), ->get_updated_html()
in_the_loop() && isset($attributes) && figure()143–146in_the_loop(), update_post_thumbnail_cache(), get_the_post_thumbnail_url(), round(), round(), wp_unique_id(), ->next_tag(), ->get_updated_html(), ->next_tag(), ->set_attribute(), ->get_updated_html(), preg_quote(), figure(), ->remove_attribute(), ->next_tag(), esc_url(), ->set_attribute(), get_post_thumbnail_id(), ->set_attribute(), get_post_thumbnail_id(), get_post_meta(), strip_tags(), ->set_attribute(), ->set_attribute(), ->get_updated_html()
!in_the_loop() && isset($attributes) && ->has_bookmark() && figure()144–147in_the_loop(), get_the_post_thumbnail_url(), round(), round(), wp_unique_id(), ->next_tag(), ->get_updated_html(), ->next_tag(), ->has_bookmark(), ->seek(), ->set_attribute(), ->get_updated_html(), preg_quote(), figure(), ->remove_attribute(), ->next_tag(), esc_url(), ->set_attribute(), get_post_thumbnail_id(), ->set_attribute(), get_post_thumbnail_id(), get_post_meta(), strip_tags(), ->set_attribute(), ->get_updated_html()
in_the_loop() && isset($attributes) && !->has_bookmark() && figure()144–147in_the_loop(), update_post_thumbnail_cache(), get_the_post_thumbnail_url(), round(), round(), wp_unique_id(), ->next_tag(), ->get_updated_html(), ->next_tag(), ->has_bookmark(), ->get_updated_html(), preg_quote(), figure(), ->remove_attribute(), ->next_tag(), esc_url(), ->set_attribute(), get_post_thumbnail_id(), ->set_attribute(), get_post_thumbnail_id(), get_post_meta(), strip_tags(), ->set_attribute(), ->set_attribute(), ->get_updated_html()
in_the_loop() && isset($attributes) && ->has_bookmark() && figure()146–149in_the_loop(), update_post_thumbnail_cache(), get_the_post_thumbnail_url(), round(), round(), wp_unique_id(), ->next_tag(), ->get_updated_html(), ->next_tag(), ->has_bookmark(), ->seek(), ->set_attribute(), ->get_updated_html(), preg_quote(), figure(), ->remove_attribute(), ->next_tag(), esc_url(), ->set_attribute(), get_post_thumbnail_id(), ->set_attribute(), get_post_thumbnail_id(), get_post_meta(), strip_tags(), ->set_attribute(), ->get_updated_html()
!in_the_loop() && isset($attributes) && ->has_bookmark() && figure()150–153in_the_loop(), get_the_post_thumbnail_url(), round(), round(), wp_unique_id(), ->next_tag(), ->get_updated_html(), ->next_tag(), ->has_bookmark(), ->seek(), ->set_attribute(), ->get_updated_html(), preg_quote(), figure(), ->remove_attribute(), ->next_tag(), esc_url(), ->set_attribute(), get_post_thumbnail_id(), ->set_attribute(), get_post_thumbnail_id(), get_post_meta(), strip_tags(), ->set_attribute(), ->set_attribute(), ->get_updated_html()
in_the_loop() && isset($attributes) && ->has_bookmark() && figure()152–155in_the_loop(), update_post_thumbnail_cache(), get_the_post_thumbnail_url(), round(), round(), wp_unique_id(), ->next_tag(), ->get_updated_html(), ->next_tag(), ->has_bookmark(), ->seek(), ->set_attribute(), ->get_updated_html(), preg_quote(), figure(), ->remove_attribute(), ->next_tag(), esc_url(), ->set_attribute(), get_post_thumbnail_id(), ->set_attribute(), get_post_thumbnail_id(), get_post_meta(), strip_tags(), ->set_attribute(), ->set_attribute(), ->get_updated_html()

Across PHP versions

PHPCompiledExecutedBranchesNotes
8.6-dev1766–15516
8.51766–15516
8.41766–155165 fewer instructions than PHP 8.3
8.31816–16016
8.21816–160161 more instruction than PHP 8.1
8.11806–162161 fewer instruction than PHP 7.4
7.41816–16316

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

Source code

function render_block_core_media_text( $attributes, $content ) {	if ( false === $attributes['useFeaturedImage'] ) {		return $content;	} 	if ( in_the_loop() ) {		update_post_thumbnail_cache();	} 	$current_featured_image = get_the_post_thumbnail_url();	if ( ! $current_featured_image ) {		return $content;	} 	$has_media_on_right = 'right' === ( $attributes['mediaPosition'] ?? null );	$image_fill         = (bool) ( $attributes['imageFill'] ?? false );	$focal_point        = isset( $attributes['focalPoint'] ) ? round( $attributes['focalPoint']['x'] * 100 ) . '% ' . round( $attributes['focalPoint']['y'] * 100 ) . '%' : '50% 50%';	$unique_id          = 'wp-block-media-text__media-' . wp_unique_id(); 	$block_tag_processor = new WP_HTML_Tag_Processor( $content );	$block_query         = array(		'tag_name'   => 'div',		'class_name' => 'wp-block-media-text',	); 	while ( $block_tag_processor->next_tag( $block_query ) ) {		if ( $image_fill ) {			// The markup below does not work with the deprecated `is-image-fill` class.			$block_tag_processor->remove_class( 'is-image-fill' );			$block_tag_processor->add_class( 'is-image-fill-element' );		}	} 	$content = $block_tag_processor->get_updated_html(); 	$media_tag_processor   = new WP_HTML_Tag_Processor( $content );	$wrapping_figure_query = array(		'tag_name'   => 'figure',		'class_name' => 'wp-block-media-text__media',	); 	if ( $has_media_on_right ) {		// Loop through all the figure tags and set a bookmark on the last figure tag.		while ( $media_tag_processor->next_tag( $wrapping_figure_query ) ) {			$media_tag_processor->set_bookmark( 'last_figure' );		}		if ( $media_tag_processor->has_bookmark( 'last_figure' ) ) {			$media_tag_processor->seek( 'last_figure' );			// Insert a unique ID to identify the figure tag.			$media_tag_processor->set_attribute( 'id', $unique_id );		}	} else {		if ( $media_tag_processor->next_tag( $wrapping_figure_query ) ) {			// Insert a unique ID to identify the figure tag.			$media_tag_processor->set_attribute( 'id', $unique_id );		}	} 	$content = $media_tag_processor->get_updated_html(); 	// Add the image tag inside the figure tag, and update the image attributes	// in order to display the featured image.	$media_size_slug = $attributes['mediaSizeSlug'] ?? 'full';	$image_tag       = '<img class="wp-block-media-text__featured_image">';	$content         = preg_replace(		'/(<figure\s+id="' . preg_quote( $unique_id, '/' ) . '"\s+class="wp-block-media-text__media"\s*>)/',		'$1' . $image_tag,		$content	); 	$image_tag_processor = new WP_HTML_Tag_Processor( $content );	if ( $image_tag_processor->next_tag(		array(			'tag_name' => 'figure',			'id'       => $unique_id,		)	) ) {		// The ID is only used to ensure that the correct figure tag is selected,		// and can now be removed.		$image_tag_processor->remove_attribute( 'id' );

Changelog

Introduced in 6.6.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 7.1.0 tag, from src/wp-includes/blocks/media-text.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.