wppaste
WordPress

WP_Theme_Install_List_Table::prepare_items()

Source
wp-admin/includes/class-wp-theme-install-list-table.php:35

Compatibility

WordPress
core
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_Theme_Install_List_Table::prepare_items() 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
Expensive

Reaches an outbound HTTP request via wp_remote_get().

Scaling
Constant

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

Instructions
86–189

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

Plugin surface
3 hooks

Third-party callbacks on 'install_themes_tabs', 'install_themes_nonmenu_tabs', 'install_themes_table_api_args_{$tab}' run inside this call, and their cost is not bounded by anything here.

Called by
0

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

What it touches

  • hookthird-party callbacksapply_filters()called directly
  • httpoutbound HTTP requestwp_remote_get()one call below WP_Theme_Install_List_Table::prepare_items()

Further down the call graph this can also reach query, 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 · 90 distinct outcomes

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

WhenInstructionsCalls it makes
empty($value) && $tab !== "search" && !empty($tab)86–104->get_pagenum(), __(), _x(), _x(), _x(), _x(), apply_filters(), apply_filters(), apply_filters()
empty($value) && $tab !== "search"88–108->get_pagenum(), __(), _x(), _x(), _x(), _x(), apply_filters(), apply_filters(), key(), apply_filters()
empty($value) && $tab === "search" && !empty($tab)91–109->get_pagenum(), __(), __(), _x(), _x(), _x(), _x(), apply_filters(), apply_filters(), apply_filters()
empty($value) && $tab === "search"93–113->get_pagenum(), __(), __(), _x(), _x(), _x(), _x(), apply_filters(), apply_filters(), key(), apply_filters()
empty($value) && $tab !== "search" && !empty($tab) && !isset($value)100–129->get_pagenum(), __(), _x(), _x(), _x(), _x(), apply_filters(), apply_filters(), add_action(), apply_filters()
empty($value) && $tab !== "search" && !isset($value)102–133->get_pagenum(), __(), _x(), _x(), _x(), _x(), apply_filters(), apply_filters(), key(), add_action(), apply_filters()
empty($value) && $tab === "search" && !empty($tab) && !isset($value)105–134->get_pagenum(), __(), __(), _x(), _x(), _x(), _x(), apply_filters(), apply_filters(), add_action(), apply_filters()
empty($value) && $tab !== "search" && !empty($tab) && !isset($value)107–130->get_pagenum(), __(), _x(), _x(), _x(), _x(), apply_filters(), apply_filters(), array_map(), add_action(), apply_filters()
empty($value) && $tab !== "search" && !empty($tab) && isset($value)107–136->get_pagenum(), __(), _x(), _x(), _x(), _x(), apply_filters(), apply_filters(), wp_unslash(), add_action(), apply_filters()
empty($value) && $tab !== "search" && !empty($tab) && !is_wp_error()107–125->get_pagenum(), __(), _x(), _x(), _x(), _x(), apply_filters(), apply_filters(), apply_filters(), themes_api(), is_wp_error(), total_items()
empty($value) && $tab === "search" && !isset($value)107–138->get_pagenum(), __(), __(), _x(), _x(), _x(), _x(), apply_filters(), apply_filters(), key(), add_action(), apply_filters()
empty($value) && $tab !== "search" && !isset($value)109–134->get_pagenum(), __(), _x(), _x(), _x(), _x(), apply_filters(), apply_filters(), key(), array_map(), add_action(), apply_filters()
78 further outcomes, up to 189 instructions
empty($value) && $tab !== "search" && isset($value)109–140->get_pagenum(), __(), _x(), _x(), _x(), _x(), apply_filters(), apply_filters(), key(), wp_unslash(), add_action(), apply_filters()
empty($value) && $tab !== "search" && !is_wp_error()109–129->get_pagenum(), __(), _x(), _x(), _x(), _x(), apply_filters(), apply_filters(), key(), apply_filters(), themes_api(), is_wp_error(), total_items()
$tab !== "search" && !empty($tab)111–121wp_unslash(), strtolower(), explode(), array_map(), array_filter(), array_unique(), ->get_pagenum(), __(), _x(), _x(), _x(), _x(), apply_filters(), apply_filters(), apply_filters()
empty($value) && $tab === "search" && !empty($tab) && !isset($value)112–135->get_pagenum(), __(), __(), _x(), _x(), _x(), _x(), apply_filters(), apply_filters(), array_map(), add_action(), apply_filters()
empty($value) && $tab === "search" && !empty($tab) && isset($value)112–141->get_pagenum(), __(), __(), _x(), _x(), _x(), _x(), apply_filters(), apply_filters(), wp_unslash(), add_action(), apply_filters()
empty($value) && $tab === "search" && !empty($tab) && !is_wp_error()112–130->get_pagenum(), __(), __(), _x(), _x(), _x(), _x(), apply_filters(), apply_filters(), apply_filters(), themes_api(), is_wp_error(), total_items()
$tab !== "search" && empty($tab)113–123wp_unslash(), strtolower(), explode(), array_map(), array_filter(), array_unique(), ->get_pagenum(), __(), _x(), _x(), _x(), _x(), apply_filters(), apply_filters(), key(), apply_filters()
empty($value) && $tab !== "search" && !empty($tab) && isset($value)114–137->get_pagenum(), __(), _x(), _x(), _x(), _x(), apply_filters(), apply_filters(), wp_unslash(), array_map(), add_action(), apply_filters()
empty($value) && $tab === "search" && !isset($value)114–139->get_pagenum(), __(), __(), _x(), _x(), _x(), _x(), apply_filters(), apply_filters(), key(), array_map(), add_action(), apply_filters()
empty($value) && $tab === "search" && isset($value)114–145->get_pagenum(), __(), __(), _x(), _x(), _x(), _x(), apply_filters(), apply_filters(), key(), wp_unslash(), add_action(), apply_filters()
empty($value) && $tab === "search" && !is_wp_error()114–134->get_pagenum(), __(), __(), _x(), _x(), _x(), _x(), apply_filters(), apply_filters(), key(), apply_filters(), themes_api(), is_wp_error(), total_items()
empty($value) && $tab !== "search" && isset($value)116–141->get_pagenum(), __(), _x(), _x(), _x(), _x(), apply_filters(), apply_filters(), key(), wp_unslash(), array_map(), add_action(), apply_filters()
empty($value) && $tab === "search" && !empty($tab) && isset($value)119–142->get_pagenum(), __(), __(), _x(), _x(), _x(), _x(), apply_filters(), apply_filters(), wp_unslash(), array_map(), add_action(), apply_filters()
empty($value) && $tab !== "search" && !empty($tab) && is_wp_error()119–137->get_pagenum(), __(), _x(), _x(), _x(), _x(), apply_filters(), apply_filters(), apply_filters(), themes_api(), is_wp_error(), ->get_error_message(), __(), wp_die(), total_items()
empty($value) && $tab !== "search" && !empty($tab) && !isset($value) && !is_wp_error()121–150->get_pagenum(), __(), _x(), _x(), _x(), _x(), apply_filters(), apply_filters(), add_action(), apply_filters(), themes_api(), is_wp_error(), total_items()
empty($value) && $tab === "search" && isset($value)121–146->get_pagenum(), __(), __(), _x(), _x(), _x(), _x(), apply_filters(), apply_filters(), key(), wp_unslash(), array_map(), add_action(), apply_filters()
empty($value) && $tab !== "search" && is_wp_error()121–141->get_pagenum(), __(), _x(), _x(), _x(), _x(), apply_filters(), apply_filters(), key(), apply_filters(), themes_api(), is_wp_error(), ->get_error_message(), __(), wp_die(), total_items()
empty($value) && $tab !== "search" && !isset($value) && !is_wp_error()123–154->get_pagenum(), __(), _x(), _x(), _x(), _x(), apply_filters(), apply_filters(), key(), add_action(), apply_filters(), themes_api(), is_wp_error(), total_items()
empty($value) && $tab === "search" && !empty($tab) && is_wp_error()124–142->get_pagenum(), __(), __(), _x(), _x(), _x(), _x(), apply_filters(), apply_filters(), apply_filters(), themes_api(), is_wp_error(), ->get_error_message(), __(), wp_die(), total_items()
$tab !== "search" && !empty($tab) && !isset($value)125–148wp_unslash(), strtolower(), explode(), array_map(), array_filter(), array_unique(), ->get_pagenum(), __(), _x(), _x(), _x(), _x(), apply_filters(), apply_filters(), add_action(), apply_filters()
empty($value) && $tab === "search" && !empty($tab) && !isset($value) && !is_wp_error()126–155->get_pagenum(), __(), __(), _x(), _x(), _x(), _x(), apply_filters(), apply_filters(), add_action(), apply_filters(), themes_api(), is_wp_error(), total_items()
empty($value) && $tab === "search" && is_wp_error()126–146->get_pagenum(), __(), __(), _x(), _x(), _x(), _x(), apply_filters(), apply_filters(), key(), apply_filters(), themes_api(), is_wp_error(), ->get_error_message(), __(), wp_die(), total_items()
$tab !== "search" && empty($tab) && !isset($value)127–148wp_unslash(), strtolower(), explode(), array_map(), array_filter(), array_unique(), ->get_pagenum(), __(), _x(), _x(), _x(), _x(), apply_filters(), apply_filters(), key(), add_action(), apply_filters()
empty($value) && $tab !== "search" && !empty($tab) && !isset($value) && !is_wp_error()128–151->get_pagenum(), __(), _x(), _x(), _x(), _x(), apply_filters(), apply_filters(), array_map(), add_action(), apply_filters(), themes_api(), is_wp_error(), total_items()
empty($value) && $tab !== "search" && !empty($tab) && isset($value) && !is_wp_error()128–157->get_pagenum(), __(), _x(), _x(), _x(), _x(), apply_filters(), apply_filters(), wp_unslash(), add_action(), apply_filters(), themes_api(), is_wp_error(), total_items()
empty($value) && $tab === "search" && !isset($value) && !is_wp_error()128–159->get_pagenum(), __(), __(), _x(), _x(), _x(), _x(), apply_filters(), apply_filters(), key(), add_action(), apply_filters(), themes_api(), is_wp_error(), total_items()
empty($value) && $tab !== "search" && !isset($value) && !is_wp_error()130–155->get_pagenum(), __(), _x(), _x(), _x(), _x(), apply_filters(), apply_filters(), key(), array_map(), add_action(), apply_filters(), themes_api(), is_wp_error(), total_items()
empty($value) && $tab !== "search" && isset($value) && !is_wp_error()130–161->get_pagenum(), __(), _x(), _x(), _x(), _x(), apply_filters(), apply_filters(), key(), wp_unslash(), add_action(), apply_filters(), themes_api(), is_wp_error(), total_items()
$tab !== "search" && !empty($tab) && !isset($value)132–149wp_unslash(), strtolower(), explode(), array_map(), array_filter(), array_unique(), ->get_pagenum(), __(), _x(), _x(), _x(), _x(), apply_filters(), apply_filters(), array_map(), add_action(), apply_filters()
$tab !== "search" && !empty($tab) && isset($value)132–155wp_unslash(), strtolower(), explode(), array_map(), array_filter(), array_unique(), ->get_pagenum(), __(), _x(), _x(), _x(), _x(), apply_filters(), apply_filters(), wp_unslash(), add_action(), apply_filters()
$tab !== "search" && !empty($tab) && !is_wp_error()132–142wp_unslash(), strtolower(), explode(), array_map(), array_filter(), array_unique(), ->get_pagenum(), __(), _x(), _x(), _x(), _x(), apply_filters(), apply_filters(), apply_filters(), themes_api(), is_wp_error(), total_items()
empty($value) && $tab === "search" && !empty($tab) && !isset($value) && !is_wp_error()133–156->get_pagenum(), __(), __(), _x(), _x(), _x(), _x(), apply_filters(), apply_filters(), array_map(), add_action(), apply_filters(), themes_api(), is_wp_error(), total_items()
empty($value) && $tab === "search" && !empty($tab) && isset($value) && !is_wp_error()133–162->get_pagenum(), __(), __(), _x(), _x(), _x(), _x(), apply_filters(), apply_filters(), wp_unslash(), add_action(), apply_filters(), themes_api(), is_wp_error(), total_items()
empty($value) && $tab !== "search" && !empty($tab) && !isset($value) && is_wp_error()133–162->get_pagenum(), __(), _x(), _x(), _x(), _x(), apply_filters(), apply_filters(), add_action(), apply_filters(), themes_api(), is_wp_error(), ->get_error_message(), __(), wp_die(), total_items()
$tab !== "search" && empty($tab) && !isset($value)134–149wp_unslash(), strtolower(), explode(), array_map(), array_filter(), array_unique(), ->get_pagenum(), __(), _x(), _x(), _x(), _x(), apply_filters(), apply_filters(), key(), array_map(), add_action(), apply_filters()
$tab !== "search" && empty($tab) && isset($value)134–155wp_unslash(), strtolower(), explode(), array_map(), array_filter(), array_unique(), ->get_pagenum(), __(), _x(), _x(), _x(), _x(), apply_filters(), apply_filters(), key(), wp_unslash(), add_action(), apply_filters()
$tab !== "search" && empty($tab) && !is_wp_error()134–144wp_unslash(), strtolower(), explode(), array_map(), array_filter(), array_unique(), ->get_pagenum(), __(), _x(), _x(), _x(), _x(), apply_filters(), apply_filters(), key(), apply_filters(), themes_api(), is_wp_error(), total_items()
empty($value) && $tab !== "search" && !empty($tab) && isset($value) && !is_wp_error()135–158->get_pagenum(), __(), _x(), _x(), _x(), _x(), apply_filters(), apply_filters(), wp_unslash(), array_map(), add_action(), apply_filters(), themes_api(), is_wp_error(), total_items()
empty($value) && $tab === "search" && !isset($value) && !is_wp_error()135–160->get_pagenum(), __(), __(), _x(), _x(), _x(), _x(), apply_filters(), apply_filters(), key(), array_map(), add_action(), apply_filters(), themes_api(), is_wp_error(), total_items()
empty($value) && $tab === "search" && isset($value) && !is_wp_error()135–166->get_pagenum(), __(), __(), _x(), _x(), _x(), _x(), apply_filters(), apply_filters(), key(), wp_unslash(), add_action(), apply_filters(), themes_api(), is_wp_error(), total_items()
empty($value) && $tab !== "search" && !isset($value) && is_wp_error()135–166->get_pagenum(), __(), _x(), _x(), _x(), _x(), apply_filters(), apply_filters(), key(), add_action(), apply_filters(), themes_api(), is_wp_error(), ->get_error_message(), __(), wp_die(), total_items()
empty($value) && $tab !== "search" && isset($value) && !is_wp_error()137–162->get_pagenum(), __(), _x(), _x(), _x(), _x(), apply_filters(), apply_filters(), key(), wp_unslash(), array_map(), add_action(), apply_filters(), themes_api(), is_wp_error(), total_items()
empty($value) && $tab === "search" && !empty($tab) && !isset($value) && is_wp_error()138–167->get_pagenum(), __(), __(), _x(), _x(), _x(), _x(), apply_filters(), apply_filters(), add_action(), apply_filters(), themes_api(), is_wp_error(), ->get_error_message(), __(), wp_die(), total_items()
$tab !== "search" && !empty($tab) && isset($value)139–156wp_unslash(), strtolower(), explode(), array_map(), array_filter(), array_unique(), ->get_pagenum(), __(), _x(), _x(), _x(), _x(), apply_filters(), apply_filters(), wp_unslash(), array_map(), add_action(), apply_filters()
empty($value) && $tab === "search" && !empty($tab) && isset($value) && !is_wp_error()140–163->get_pagenum(), __(), __(), _x(), _x(), _x(), _x(), apply_filters(), apply_filters(), wp_unslash(), array_map(), add_action(), apply_filters(), themes_api(), is_wp_error(), total_items()
empty($value) && $tab !== "search" && !empty($tab) && !isset($value) && is_wp_error()140–163->get_pagenum(), __(), _x(), _x(), _x(), _x(), apply_filters(), apply_filters(), array_map(), add_action(), apply_filters(), themes_api(), is_wp_error(), ->get_error_message(), __(), wp_die(), total_items()
empty($value) && $tab !== "search" && !empty($tab) && isset($value) && is_wp_error()140–169->get_pagenum(), __(), _x(), _x(), _x(), _x(), apply_filters(), apply_filters(), wp_unslash(), add_action(), apply_filters(), themes_api(), is_wp_error(), ->get_error_message(), __(), wp_die(), total_items()
empty($value) && $tab === "search" && !isset($value) && is_wp_error()140–171->get_pagenum(), __(), __(), _x(), _x(), _x(), _x(), apply_filters(), apply_filters(), key(), add_action(), apply_filters(), themes_api(), is_wp_error(), ->get_error_message(), __(), wp_die(), total_items()
$tab !== "search" && empty($tab) && isset($value)141–156wp_unslash(), strtolower(), explode(), array_map(), array_filter(), array_unique(), ->get_pagenum(), __(), _x(), _x(), _x(), _x(), apply_filters(), apply_filters(), key(), wp_unslash(), array_map(), add_action(), apply_filters()
empty($value) && $tab === "search" && isset($value) && !is_wp_error()142–167->get_pagenum(), __(), __(), _x(), _x(), _x(), _x(), apply_filters(), apply_filters(), key(), wp_unslash(), array_map(), add_action(), apply_filters(), themes_api(), is_wp_error(), total_items()
empty($value) && $tab !== "search" && !isset($value) && is_wp_error()142–167->get_pagenum(), __(), _x(), _x(), _x(), _x(), apply_filters(), apply_filters(), key(), array_map(), add_action(), apply_filters(), themes_api(), is_wp_error(), ->get_error_message(), __(), wp_die(), total_items()
empty($value) && $tab !== "search" && isset($value) && is_wp_error()142–173->get_pagenum(), __(), _x(), _x(), _x(), _x(), apply_filters(), apply_filters(), key(), wp_unslash(), add_action(), apply_filters(), themes_api(), is_wp_error(), ->get_error_message(), __(), wp_die(), total_items()
$tab !== "search" && !empty($tab) && is_wp_error()144–154wp_unslash(), strtolower(), explode(), array_map(), array_filter(), array_unique(), ->get_pagenum(), __(), _x(), _x(), _x(), _x(), apply_filters(), apply_filters(), apply_filters(), themes_api(), is_wp_error(), ->get_error_message(), __(), wp_die(), total_items()
empty($value) && $tab === "search" && !empty($tab) && !isset($value) && is_wp_error()145–168->get_pagenum(), __(), __(), _x(), _x(), _x(), _x(), apply_filters(), apply_filters(), array_map(), add_action(), apply_filters(), themes_api(), is_wp_error(), ->get_error_message(), __(), wp_die(), total_items()
empty($value) && $tab === "search" && !empty($tab) && isset($value) && is_wp_error()145–174->get_pagenum(), __(), __(), _x(), _x(), _x(), _x(), apply_filters(), apply_filters(), wp_unslash(), add_action(), apply_filters(), themes_api(), is_wp_error(), ->get_error_message(), __(), wp_die(), total_items()
$tab !== "search" && !empty($tab) && !isset($value) && !is_wp_error()146–169wp_unslash(), strtolower(), explode(), array_map(), array_filter(), array_unique(), ->get_pagenum(), __(), _x(), _x(), _x(), _x(), apply_filters(), apply_filters(), add_action(), apply_filters(), themes_api(), is_wp_error(), total_items()
$tab !== "search" && empty($tab) && is_wp_error()146–156wp_unslash(), strtolower(), explode(), array_map(), array_filter(), array_unique(), ->get_pagenum(), __(), _x(), _x(), _x(), _x(), apply_filters(), apply_filters(), key(), apply_filters(), themes_api(), is_wp_error(), ->get_error_message(), __(), wp_die(), total_items()
empty($value) && $tab !== "search" && !empty($tab) && isset($value) && is_wp_error()147–170->get_pagenum(), __(), _x(), _x(), _x(), _x(), apply_filters(), apply_filters(), wp_unslash(), array_map(), add_action(), apply_filters(), themes_api(), is_wp_error(), ->get_error_message(), __(), wp_die(), total_items()
empty($value) && $tab === "search" && !isset($value) && is_wp_error()147–172->get_pagenum(), __(), __(), _x(), _x(), _x(), _x(), apply_filters(), apply_filters(), key(), array_map(), add_action(), apply_filters(), themes_api(), is_wp_error(), ->get_error_message(), __(), wp_die(), total_items()
empty($value) && $tab === "search" && isset($value) && is_wp_error()147–178->get_pagenum(), __(), __(), _x(), _x(), _x(), _x(), apply_filters(), apply_filters(), key(), wp_unslash(), add_action(), apply_filters(), themes_api(), is_wp_error(), ->get_error_message(), __(), wp_die(), total_items()
$tab !== "search" && empty($tab) && !isset($value) && !is_wp_error()148–169wp_unslash(), strtolower(), explode(), array_map(), array_filter(), array_unique(), ->get_pagenum(), __(), _x(), _x(), _x(), _x(), apply_filters(), apply_filters(), key(), add_action(), apply_filters(), themes_api(), is_wp_error(), total_items()
empty($value) && $tab !== "search" && isset($value) && is_wp_error()149–174->get_pagenum(), __(), _x(), _x(), _x(), _x(), apply_filters(), apply_filters(), key(), wp_unslash(), array_map(), add_action(), apply_filters(), themes_api(), is_wp_error(), ->get_error_message(), __(), wp_die(), total_items()
empty($value) && $tab === "search" && !empty($tab) && isset($value) && is_wp_error()152–175->get_pagenum(), __(), __(), _x(), _x(), _x(), _x(), apply_filters(), apply_filters(), wp_unslash(), array_map(), add_action(), apply_filters(), themes_api(), is_wp_error(), ->get_error_message(), __(), wp_die(), total_items()
$tab !== "search" && !empty($tab) && !isset($value) && !is_wp_error()153–170wp_unslash(), strtolower(), explode(), array_map(), array_filter(), array_unique(), ->get_pagenum(), __(), _x(), _x(), _x(), _x(), apply_filters(), apply_filters(), array_map(), add_action(), apply_filters(), themes_api(), is_wp_error(), total_items()
$tab !== "search" && !empty($tab) && isset($value) && !is_wp_error()153–176wp_unslash(), strtolower(), explode(), array_map(), array_filter(), array_unique(), ->get_pagenum(), __(), _x(), _x(), _x(), _x(), apply_filters(), apply_filters(), wp_unslash(), add_action(), apply_filters(), themes_api(), is_wp_error(), total_items()
empty($value) && $tab === "search" && isset($value) && is_wp_error()154–179->get_pagenum(), __(), __(), _x(), _x(), _x(), _x(), apply_filters(), apply_filters(), key(), wp_unslash(), array_map(), add_action(), apply_filters(), themes_api(), is_wp_error(), ->get_error_message(), __(), wp_die(), total_items()
$tab !== "search" && empty($tab) && !isset($value) && !is_wp_error()155–170wp_unslash(), strtolower(), explode(), array_map(), array_filter(), array_unique(), ->get_pagenum(), __(), _x(), _x(), _x(), _x(), apply_filters(), apply_filters(), key(), array_map(), add_action(), apply_filters(), themes_api(), is_wp_error(), total_items()
$tab !== "search" && empty($tab) && isset($value) && !is_wp_error()155–176wp_unslash(), strtolower(), explode(), array_map(), array_filter(), array_unique(), ->get_pagenum(), __(), _x(), _x(), _x(), _x(), apply_filters(), apply_filters(), key(), wp_unslash(), add_action(), apply_filters(), themes_api(), is_wp_error(), total_items()
$tab !== "search" && !empty($tab) && !isset($value) && is_wp_error()158–181wp_unslash(), strtolower(), explode(), array_map(), array_filter(), array_unique(), ->get_pagenum(), __(), _x(), _x(), _x(), _x(), apply_filters(), apply_filters(), add_action(), apply_filters(), themes_api(), is_wp_error(), ->get_error_message(), __(), wp_die(), total_items()
$tab !== "search" && !empty($tab) && isset($value) && !is_wp_error()160–177wp_unslash(), strtolower(), explode(), array_map(), array_filter(), array_unique(), ->get_pagenum(), __(), _x(), _x(), _x(), _x(), apply_filters(), apply_filters(), wp_unslash(), array_map(), add_action(), apply_filters(), themes_api(), is_wp_error(), total_items()
$tab !== "search" && empty($tab) && !isset($value) && is_wp_error()160–181wp_unslash(), strtolower(), explode(), array_map(), array_filter(), array_unique(), ->get_pagenum(), __(), _x(), _x(), _x(), _x(), apply_filters(), apply_filters(), key(), add_action(), apply_filters(), themes_api(), is_wp_error(), ->get_error_message(), __(), wp_die(), total_items()
$tab !== "search" && empty($tab) && isset($value) && !is_wp_error()162–177wp_unslash(), strtolower(), explode(), array_map(), array_filter(), array_unique(), ->get_pagenum(), __(), _x(), _x(), _x(), _x(), apply_filters(), apply_filters(), key(), wp_unslash(), array_map(), add_action(), apply_filters(), themes_api(), is_wp_error(), total_items()
$tab !== "search" && !empty($tab) && !isset($value) && is_wp_error()165–182wp_unslash(), strtolower(), explode(), array_map(), array_filter(), array_unique(), ->get_pagenum(), __(), _x(), _x(), _x(), _x(), apply_filters(), apply_filters(), array_map(), add_action(), apply_filters(), themes_api(), is_wp_error(), ->get_error_message(), __(), wp_die(), total_items()
$tab !== "search" && !empty($tab) && isset($value) && is_wp_error()165–188wp_unslash(), strtolower(), explode(), array_map(), array_filter(), array_unique(), ->get_pagenum(), __(), _x(), _x(), _x(), _x(), apply_filters(), apply_filters(), wp_unslash(), add_action(), apply_filters(), themes_api(), is_wp_error(), ->get_error_message(), __(), wp_die(), total_items()
$tab !== "search" && empty($tab) && !isset($value) && is_wp_error()167–182wp_unslash(), strtolower(), explode(), array_map(), array_filter(), array_unique(), ->get_pagenum(), __(), _x(), _x(), _x(), _x(), apply_filters(), apply_filters(), key(), array_map(), add_action(), apply_filters(), themes_api(), is_wp_error(), ->get_error_message(), __(), wp_die(), total_items()
$tab !== "search" && empty($tab) && isset($value) && is_wp_error()167–188wp_unslash(), strtolower(), explode(), array_map(), array_filter(), array_unique(), ->get_pagenum(), __(), _x(), _x(), _x(), _x(), apply_filters(), apply_filters(), key(), wp_unslash(), add_action(), apply_filters(), themes_api(), is_wp_error(), ->get_error_message(), __(), wp_die(), total_items()
$tab !== "search" && !empty($tab) && isset($value) && is_wp_error()172–189wp_unslash(), strtolower(), explode(), array_map(), array_filter(), array_unique(), ->get_pagenum(), __(), _x(), _x(), _x(), _x(), apply_filters(), apply_filters(), wp_unslash(), array_map(), add_action(), apply_filters(), themes_api(), is_wp_error(), ->get_error_message(), __(), wp_die(), total_items()
$tab !== "search" && empty($tab) && isset($value) && is_wp_error()174–189wp_unslash(), strtolower(), explode(), array_map(), array_filter(), array_unique(), ->get_pagenum(), __(), _x(), _x(), _x(), _x(), apply_filters(), apply_filters(), key(), wp_unslash(), array_map(), add_action(), apply_filters(), themes_api(), is_wp_error(), ->get_error_message(), __(), wp_die(), total_items()

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

Across PHP versions

PHPCompiledExecutedBranchesNotes
8.6-dev23386–188202 fewer instructions than PHP 8.5
8.523586–18920
8.423586–189206 fewer instructions than PHP 8.3
8.324186–19520
8.224186–195202 more instructions than PHP 8.1
8.123986–19120
7.423986–19120

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 WP_Theme_Install_List_Table::prepare_items() runs, in this order:

  1. apply_filters( install_themes_tabs )filterline 72 (+37 into the body)

    Filters the tabs shown on the Add Themes screen.

  2. apply_filters( install_themes_nonmenu_tabs )filterline 82 (+47 into the body)

    Filters tabs not associated with a menu item on the Install Themes screen.

  3. apply_filters( install_themes_table_api_args_{$tab} )filterline 150 (+115 into the body)

    Filters API request arguments for each Install Themes screen tab.

Uses · 11

  • sanitize_text_field()Sanitizes a string from user input or from the database.
  • wp_unslash()Removes slashes from a string or recursively removes slashes from strings within an array.
  • __()Retrieves the translation of $text.
  • _x()Retrieves translated string with gettext context.
  • apply_filters()Calls the callback functions that have been added to a filter hook.
  • add_action()Adds a callback function to an action hook.
  • themes_api()Retrieves theme installer pages from the WordPress.org Themes API.
  • is_wp_error()Checks whether the given variable is a WordPress Error.
  • wp_die()Kills WordPress execution and displays HTML page with an error message.
  • WP_Theme_Install_List_Table::get_pagenum()
  • WP_Theme_Install_List_Table::set_pagination_args()

Source code

	public function prepare_items() {		require ABSPATH . 'wp-admin/includes/theme-install.php'; 		global $tabs, $tab, $paged, $type, $theme_field_defaults; 		$tab = ! empty( $_REQUEST['tab'] ) ? sanitize_text_field( $_REQUEST['tab'] ) : ''; 		$search_terms  = array();		$search_string = '';		if ( ! empty( $_REQUEST['s'] ) ) {			$search_string = strtolower( wp_unslash( $_REQUEST['s'] ) );			$search_terms  = array_unique( array_filter( array_map( 'trim', explode( ',', $search_string ) ) ) );		} 		if ( ! empty( $_REQUEST['features'] ) ) {			$this->features = $_REQUEST['features'];		} 		$paged = $this->get_pagenum(); 		$per_page = 36; 		// These are the tabs which are shown on the page,		$tabs              = array();		$tabs['dashboard'] = __( 'Search' );		if ( 'search' === $tab ) {			$tabs['search'] = __( 'Search Results' );		}		$tabs['upload']   = _x( 'Upload', 'noun' );		$tabs['featured'] = _x( 'Featured', 'themes' );		//$tabs['popular']  = _x( 'Popular', 'themes' );		$tabs['new']     = _x( 'Latest', 'themes' );		$tabs['updated'] = _x( 'Recently Updated', 'themes' ); 		$nonmenu_tabs = array( 'theme-information' ); // Valid actions to perform which do not have a Menu item. 		/** This filter is documented in wp-admin/theme-install.php */		$tabs = apply_filters( 'install_themes_tabs', $tabs ); 		/**		 * Filters tabs not associated with a menu item on the Install Themes screen.		 *		 * @since 2.8.0		 *		 * @param string[] $nonmenu_tabs The tabs that don't have a menu item on		 *                               the Install Themes screen.		 */		$nonmenu_tabs = apply_filters( 'install_themes_nonmenu_tabs', $nonmenu_tabs ); 		// If a non-valid menu tab has been selected, And it's not a non-menu action.		if ( empty( $tab ) || ( ! isset( $tabs[ $tab ] ) && ! in_array( $tab, (array) $nonmenu_tabs, true ) ) ) {			$tab = key( $tabs );		} 		$args = array(			'page'     => $paged,			'per_page' => $per_page,			'fields'   => $theme_field_defaults,		); 		switch ( $tab ) {			case 'search':				$type = isset( $_REQUEST['type'] ) ? wp_unslash( $_REQUEST['type'] ) : 'term';				switch ( $type ) {					case 'tag':						$args['tag'] = array_map( 'sanitize_key', $search_terms );						break;					case 'term':						$args['search'] = $search_string;						break;					case 'author':						$args['author'] = $search_string;						break;				} 				if ( ! empty( $this->features ) ) {					$args['tag']      = $this->features;					$_REQUEST['s']    = implode( ',', $this->features );					$_REQUEST['type'] = 'tag';				}

Changelog

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-admin/includes/class-wp-theme-install-list-table.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.