Introduce 'tag-link-position-x' class to tag cloud links.

The new class describes the cardinal position of a link in the cloud, allowing
more fine-grained CSS and JS targeting.

Props Mte90, chmac.
Fixes #5172.

git-svn-id: https://develop.svn.wordpress.org/trunk@35984 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Boone Gorges
2015-12-17 16:26:06 +00:00
parent 62abc10870
commit 22b0cb2029
2 changed files with 33 additions and 12 deletions

View File

@@ -904,7 +904,8 @@ function wp_generate_tag_cloud( $tags, $args = '' ) {
// generate the output links array
foreach ( $tags_data as $key => $tag_data ) {
$a[] = "<a href='" . esc_url( $tag_data['url'] ) . "' class='" . esc_attr( $tag_data['class'] ) . "' title='" . esc_attr( $tag_data['title'] ) . "' style='font-size: " . esc_attr( str_replace( ',', '.', $tag_data['font_size'] ) . $args['unit'] ) . ";'>" . esc_html( $tag_data['name'] ) . "</a>";
$class = $tag_data['class'] . ' tag-link-position-' . ( $key + 1 );
$a[] = "<a href='" . esc_url( $tag_data['url'] ) . "' class='" . esc_attr( $class ) . "' title='" . esc_attr( $tag_data['title'] ) . "' style='font-size: " . esc_attr( str_replace( ',', '.', $tag_data['font_size'] ) . $args['unit'] ) . ";'>" . esc_html( $tag_data['name'] ) . "</a>";
}
switch ( $args['format'] ) {