$rows * @return array */ public function addURLToTermsRows($rows) { global $wp_rewrite; $extraPermaStructureCache = array(); foreach ($rows as $row) { $taxonomy = isset($row->taxonomy) ? (string)$row->taxonomy : ''; if (!array_key_exists($taxonomy, $extraPermaStructureCache)) { $extraPermaStructureCache[$taxonomy] = $wp_rewrite->get_extra_permastruct($taxonomy); } $struct = $extraPermaStructureCache[$taxonomy]; $slug = isset($row->slug) ? (string)$row->slug : ''; $url = str_replace('%' . $taxonomy . '%', $slug, $struct); /** @var \stdClass $row */ $row->url = $url; } return $rows; } }