getherbert / herbert

The WordPress Plugin Framework:
http://getherbert.com/
632 stars 94 forks source link

get metas ? #123

Closed imajim closed 8 years ago

imajim commented 8 years ago

Hello,

I've recorded a POST and his metaKeys/metaValues with :

$annonceImmo->create($attributes)->meta()->saveMany($args)

It's working, no problem, data are recorded in DB. But if I call :

$annonce = Post::find($post->ID);
  foreach($annonce->meta() as $meta){
            var_dump($meta);
        }

return nothing. Any Ideas to get the metas associeted to a post ?

imajim commented 8 years ago

ok, i found this :

$annonce = AnnonceImmo::find($post->ID);
foreach($annonce->meta()->get() as $meta){
        ...
}
jeremyzahner commented 8 years ago

@imajim I'm closing this issue, assuming that you were able to find what you were looking for. Feel free to reopen it if that isn't the case.