Closed marcoboom closed 6 years ago
@marcoboom hey! you mean instead of passing a Post
object a Model
one?
If both Post and Taxonomy extends Model, then that would solve the typehinting issue. Do you think that is the only issue for getting this work?
@marcoboom actually I don't see reasons to that:
Post::find(1)->acf->text('name'); // ok
I think when would I do this?
Post::find(1)->taxonomy(...)->acf->text(..);
ACF fields are related to posts only. Or am I wrong? :-)
@jgrossi No, ACF fields kan be available on Posts, Taxonomies, Users and even special admin option pages.
Big issue I think is that meta data of taxonomies are saved in another table: wp_termmeta
@marcoboom hm got it... yep, maybe just verifying if $model instanceof Taxonomy
getting data from wp_termmeta
, else if it's a Post
get from wp_postmeta
like it currently does...
but I think this is a great addition btw ;-)
Is there a PR being submitted for this?
Sent some PRs let me know what you think @jgrossi
Hi @jgrossi,
What do you think what would be the impact to make the ACF package compatible with taxonomies?
All Field class has now a dependency with the Post class, can we make that dynamic?