getdave / Tanlinell

Boilerplate Wordpress theme for rapid development of new WP themes. Based on the great work of the _s ("Underscore") theme.
GNU General Public License v2.0
6 stars 2 forks source link

Update tanlinell_get_post_meta #311

Closed neilberry001 closed 10 years ago

neilberry001 commented 10 years ago
function tanlinell_get_post_meta( $post = false ) {

    $post = ( false == $post ) ? get_post() : ( is_int( $post ) ) ? get_post( $post ) : $post ;
    $post_meta = false;

    if ( false != $post ) :

        $all_meta = get_post_meta( $post->ID, '', true );

        if ( false != $all_meta ) :

            foreach( $all_meta AS $key=>$value )
                if( false != $value[0] )
                    $post_meta[$key] = $value[0];

        endif;

    endif;

    return $post_meta;

}