I am trying to understand how the Admin Tables are populated (for posts, users, plugins...).
With Terms/Taxonomies I am confused. In the /wp-admin/edit-tags.php file everything is normal until we reach the $wp_list_table->prepare_items()
method (where an $args
is set up to later on go fetch data), but from there on I don't understand where the actual database query takes place.
Looking at the WP Users List Table's prepare_items()
method, it's quite clear:
$wp_user_search = new WP_User_Query($args);
$this->items = $wp_user_search->get_results();
So I expected a similar approach for Terms, but looking at the WP Terms List Table class, you can find:
public function has_items(){
// todo: populate $this->items in prepare_items()
return true;
}
Which means that the items are loaded somewhere else. But where?