Forum Replies Created
-
AuthorPosts
-
Anh Tran
KeymasterHi Sergio,
Your question is great! I think checking the user privilege on
template_redirectis the correct way. Maybe check if user is logged in, and is the user the author of that post / or is user an admin. That might be enough.Anh Tran
KeymasterHello,
I answered you on Facebook. I tested and couldn't replicate the bug. Am I missing something?
Anh Tran
KeymasterHi,
I think it's possible. For example, if you have a select field, you can set the options from current user post meta like this:
$user_id = get_current_user_id(); $options = get_user_meta( $user_id, 'meta_key', false ); // false to returns an array // In select field 'options' => $options,Anh Tran
KeymasterHi,
Regarding the first option, to add constraints between fields, I think the only way to do that is with custom JS.
To save sum of some fields, please use rwmb_after_save_post hook. Here you can get fields' values and update the sum to another field:
add_action( 'rwmb_after_save_post', function( $post_id ) { $field_1 = get_post_meta( $post_id, 'field_1', true ); $field_2 = get_post_meta( $post_id, 'field_2', true ); $field_3 = get_post_meta( $post_id, 'field_3', true ); $sum = $field_1 + $field_2 + $field_3; update_post_meta( $post_id, 'sum', $sum); } );Anh Tran
KeymasterHi, I think that's doable with some hook.
Like you use a
taxonomy_advancedto save the term IDs in the custom table. Then you hook to "after save post" to set the terms for the post.This is what I have in my mind:
add_action( 'rwmb_YOURFIELD_after_save_field', function ( $null, $field, $new, $old, $post_id ) { $taxonomy = reset( $field['taxonomy' ); wp_set_object_terms( $post_id, $new, $taxonomy ); }, 10, 5 );Change
YOURFIELDto your field ID.Anh Tran
KeymasterHi, the
stdtakes a value from theoptionsattribute of the field.Don't that work on new posts?
Anh Tran
KeymasterHi yumikom, please try the
rwmb_the_valuefilter:add_filter( 'rwmb_get_value', function( $value, $field, $args, $object_id ) { if ( 'wysiwyg' === $field['type'] ) { $value = do_shortcode( $value ); } return $value; }, 10, 4 );Anh Tran
KeymasterHi Gil, I've just got your contact message and sent you the invoice. Please check your inbox.
Anh Tran
KeymasterHi Galen, this error is caused when you have both AIO and MB Custom Post Type plugin enabled. I'll update the MB Custom Post Type to make a better check.
Thanks for your feedback!
Anh Tran
KeymasterHi, please follow the docs here. It's quite clear (as I can't say anything clearer). And if there's something you don't understand, please let me know.
Anh Tran
KeymasterHi Milen,
In the WP REST API docs (link I posted above), you don't need to make your own queries. It's automatically created when you visit
domain.com/wp-json/wp/v2/posts, you'll see something like this (I just access the Meta Box's URL: https://metabox.io/wp-json/wp/v2/posts/ - you can click on that to see the result):Anh Tran
KeymasterHi Sandra, the fix is available in the standalone extension Meta Box - Elementor Integrator. The AIO update will be updated in a few days.
March 26, 2019 at 5:46 PM in reply to: ✅Don't understand how to proceed after setting up custom table #13934Anh Tran
KeymasterHi Adam,
I've created a video tutorial for you, please watch it and let me know if you have any difficulty.
Anh Tran
KeymasterHi, we're working on this. I'll closed this topic as it's duplicated with this one.
Anh Tran
KeymasterHi Johannes,
I'm afraid this is impossible. The plugin always save all selected items in all select dropdown.
-
AuthorPosts