Forum Replies Created
-
AuthorPosts
-
Anh Tran
KeymasterHi,
I've just tested your code and it works for me. Here is the video:
Can you please check again? Probably there's some hooks elsewhere that modifies the requests?
Anh Tran
KeymasterHello,
I've just tested again with the custom table for only 1 CPT. When I save another CPT, there's nothing happened. Can you please check again? Maybe there's somewhere else that you use the same CPT.
Anh Tran
KeymasterI'm not sure about the quick edit for groups. It's kind of custom output + JavaScript. As long as you format the submitted data in correct way (e.g. array of sub-fields values), it might work. So, please be very careful about the data, or you might lost them.
Anh Tran
KeymasterHello,
I've just did a similar test and it works for me. Do you have any filter/code that change the query? Some kind of hooks to
pre_get_posts,query_vars, etc.?Anh Tran
KeymasterThat's cool. Is the global
$postobject is available and set to the being edited post inside the filter?Anh Tran
KeymasterYes, you can do that. However, because PHP doesn't allow to use same keys in an array, you need to change the selector to something else (while still make it work):
'input_value' => array( 'input[name=rnr_wr_pagetype]' => 'st2', 'input[name*=rnr_wr_pagetype]' => 'st3', ),Anh Tran
KeymasterSorry, I missed that. I thought the code is the code that you're using.
Yes, there's a bug with the image_select field. It uses radio for inputs, so we can't use
#field_idin our rules. Please change it to[name=rnr_wr_pagetype]and update the plugin.Anh Tran
KeymasterHello,
I've checked your code and it works for me. Here is the video:
Please check the
$prefixagain. Probably you missed it.Anh Tran
KeymasterHello,
The MB Frontend Submission uses WordPress
wp_insert_post()andwp_update_post()to create/update a post. Both functions fire thesave_posthook. So, your code still works in the frontend. Please try and let me know how it goes.Anh Tran
KeymasterI see. The code that I posted above works for whole website, because that's the only PHP hook WordPress provides. And it's site-wide.
If your CPT doesn't have any other upload fields, then you can add some PHP checks to make sure the filter runs only for that CPT only. That might work.
And if you can hook into the ajax process, please share with us. I'm curious how to do that, too.
Anh Tran
KeymasterHi, you can use a hidden field for that purpose. Alternatively you can hide it with CSS. Or more advanced - use MB Conditional Logic to hide it.
Anh Tran
KeymasterHello,
Regarding the code to show a sub-field inside a group, your code is correct and that is a nice approach. I guest that's the best way to do it.
Sorting seems not to be doable for group values, unfortunately. The quick edit is not available at the moment, neither (we haven't done that for normal fields as well).
Regrading your data, I think you can just create a group called
variation(a combination, you can find any better name) and it has 3 sub-fields:- Size: can be a select field if number of sizes are limited
- Batch: a text field or select field (if you have predefined batches)
- Amount of bottles: number field
- Price
Then you can show those info in the admin columns in a similar way that you already did above (with similar code).
Anh Tran
KeymasterHi,
I'm not really clear about the question. Do you mean automatically assigning category for some posts selected in a settings page?
Anh Tran
KeymasterHello, the query to get connected posts seems to be ok. What error did you see? Can you please post the code that you use it and see it failed?
Anh Tran
KeymasterHello,
Yes, we do. Please use MB Group for repeater field. You can define any sub-fields inside, even another groups.
For flexible repeater field, please use MB Group with MB Conditional Logic to load sub-fields based on some condition.
-
AuthorPosts