Navigation Menu

Skip to content

Commit

Permalink
Use sanitize_html_class() for image classes.
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.locallylost.com/themes/hybrid-core/trunk@966 dba0f204-706d-4bc1-bc29-8b92e0485636
  • Loading branch information
greenshady committed Jan 1, 2012
1 parent 1424580 commit 2c820a3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions extensions/get-the-image.php
Expand Up @@ -395,12 +395,12 @@ function get_the_image_format( $args = array(), $image = false ) {
/* Loop through the custom field keys and add them as classes. */
if ( is_array( $meta_key ) ) {
foreach ( $meta_key as $key )
$classes[] = str_replace( ' ', '-', strtolower( $key ) );
$classes[] = sanitize_html_class( $key );
}

/* Add the $size and any user-added $image_class to the class. */
$classes[] = $size;
$classes[] = $image_class;
$classes[] = sanitize_html_class( $size );
$classes[] = sanitize_html_class( $image_class );

/* Join all the classes into a single string and make sure there are no duplicates. */
$class = join( ' ', array_unique( $classes ) );
Expand Down

0 comments on commit 2c820a3

Please sign in to comment.