[wp-hackers] get_theme_support( 'post-formats' )

Chip Bennett chip at chipbennett.net
Wed Jan 12 15:38:33 UTC 2011


That's exactly what I was curious about. Thanks for clarifying, Otto!

Chip

On Wed, Jan 12, 2011 at 9:34 AM, Otto <otto at ottodestruct.com> wrote:

> On Wed, Jan 12, 2011 at 8:57 AM, Chip Bennett <chip at chipbennett.net>
> wrote:
> > $my_theme_supports = get_theme_support( 'post-formats' );
> > ...should result in, e.g.
> > $my_theme_supports = array( 'aside', 'gallery' );
>
> Actually, it returns an array with an array in it.
>
> array(1) { [0]=> array(9) {
> [0]=> string(5) "aside" [1]=> string(5) "audio" ...
> } }
>
> So you'll want to reference it with the [0].
>
> Simple code:
> $my_theme_supports = get_theme_support( 'post-formats' );
> if (is_array($my_theme_supports)) $my_theme_supports =
> $my_theme_supports[0];
>
> Now you'll have what you expect it to be.
>
> -Otto
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers
>


More information about the wp-hackers mailing list