Get Post Meta

If you want to get all post meta, you can use the snippet below:

function get_post_meta_all( $post_id ) {
    global $wpdb;
    $data = array();
    $wpdb->query( "SELECT `meta_key`, `meta_value` FROM $wpdb->postmeta WHERE `post_id` = $post_id" );
    foreach ( $wpdb->last_result as $k => $v ) {
        $data[ $v->meta_key ] = $v->meta_value;
    };

    return $data;
}