Forum Replies Created
-
AuthorPosts
-
Jackky
ParticipantAlso you can use current_user_can() condition instead ๐
Jackky
ParticipantNo, not for only that reason. This is global custom class, that covers wp_ajax at all and simplify it, like your metabox class simplify classic way to make metaboxes. The lib, that I give you a link is unique, but nobody knows about this lib. Just test it and I wish it will inspire you to make more better ajax class and maybe create another metabox.io-sized project ๐
Jackky
ParticipantGive me an example please
Jackky
ParticipantYep, you can easily write simple jQuery code and enqueue it for admin.
Jackky
ParticipantAlso I have realised, that I can make this with custom_html callback. But maybe it can be good idea, to make opportunity to use select_advanced?
Jackky
ParticipantOh, I have just figured out, that taxanomy option, could be an array
'taxonomy' => array('animators','servicies','costumes'),
That solves my task in different way. Mark here https://metabox.io/docs/define-fields/#section-taxonomy that taxonomy could be an array or string.
And take your look at the problem with js above. Think it's important.Jackky
ParticipantOk, thats worked better, but I don't like, that returned value in array had different second key, maybe there is a way to make id unique, but key equal? Also there still a small problem: when I clone the group, condition in the new clone doesn't work until I save the post (looks like it isn't in DOM).
Jackky
ParticipantWhen I changed 'field_type' to 'radio_list', it starts working, but only after I clone group, then save the page, and then I able to change condition in each created clone. But radio_list style is bad, I want to make it select or select_advanced.
Jackky
ParticipantFind out some interesting thing:
If we change condition to
'hidden' => array( 'front_cats[1][front_cat_type]', '!=', 'animator' )
it will work for second clone only. So I just need to put something like php marker like front_cats[%s][front_cat_type] to make condition unique. How to do this? -
AuthorPosts