get_the_category_list
runs it output through the filter the_category
. You could hook in there and change whatever you like. Something like this should work (untested):
<?php
add_filter('the_category', 'wpse90955_the_category');
function wpse90955_the_category($cat_list)
{
return str_ireplace('<a', '<a target="_parent"', $cat_list);
}
If you just need to have that list filter in certain spots, you can define the function above in a plugin or theme’s functions.php
, then add the filter, call get_the_category_list
, and remove the filter.
<?php
// assume wpse90955_the_category was defined elsewhere and is already loaded
add_filter('the_category', 'wpse90955_the_category');
echo get_the_category_list($some_sep, $parents, $some_post_id);
remove_filter('the_category', 'wpse90955_the_category');