Here’s what I have
foreach ( $post_formats as $format ) {
if ( $options['show_post_formats'][$format] == 0 ) {
$format = 'post-format-' . $format;
array_push( $hide, $format );
}
}
and it works fine … but gives me an Undefined index: error when I debug because it wants the value of $format to be in quotes. How would I do this properly?
as your not sure the index will be there you simply use !empty() and check the array key exists.