Forum Replies Created
-
AuthorPosts
-
June 30, 2018 at 12:47 PM in reply to: ✅How to maintain a counter/score based on values in radio boxes? #10385
Anh Tran
KeymasterHi,
To make things easier, I'd suggest adding a common CSS class (
like) for all the radios. You can do that with theclassattribute of the field.Then, you can perform some JS code like this:
- Get total value:
var total = 0; $( '.like input:checked' ).each( function() { total += $(this).val(); } ); // Output total somewhere $( '#selector' ).text( total );Anyway, as all the radio have values
1or0, the total value is equal to the number of "likes", which can be done with the following code.- Get number of likes:
var total = $( '.like input:checked' ).length; // Show an error message if ( total > 30 ) { alert( 'You have selected more than 30 likes. Please select again' ); // or $( '.error-message' ).text( 'You have selected more than 30 likes. Please select again' ); }Anh Tran
KeymasterHi David,
When you create a table, you can set which column(s) are indexed. Just put the columns you want to index in the last param of
MB_Custom_Table_API::createfunction.For example, this code will index the column
email:MB_Custom_Table_API::create( 'my_custom_table', array( 'address' => 'TEXT NOT NULL', 'phone' => 'TEXT NOT NULL', 'email' => 'VARCHAR(20) NOT NULL', ), array( 'email' ) );See the docs for more info.
If you want to do that manually with raw SQL, you can do that via a tool like phpMyAdmin.
June 28, 2018 at 5:07 PM in reply to: How to allow editing field values thru Frontend Submission by the author only? #10372Anh Tran
KeymasterYou can:
- Get the author of the submitted post (via
post_id) - Get the current user ID
And just compare them. When they match, output the shortcode. Otherwise, output some error message.
Anh Tran
KeymasterHi,
This line is correct:
echo wpautop( $rwmb_meta( 'blog_intro', '' $blog_id ) );However, both wpautop and non-wpautop versions have nothing to do with
divtags. They only wrap paragraphs intoptags and ignores thebr. Thedivmust be entered in the field content. So I'd suggest you ask for the access to the field content and make the change manually, or ask who entered that check the markup in the "Text" mode.June 25, 2018 at 10:14 AM in reply to: Options callback is adding single quotes around the function call #10345Anh Tran
KeymasterHi Alex,
All values in the custom attributes are treated as strings. If we make it run as PHP code, then we have to use something similar to
eval, which can open to many security issues. I think it's should be avoided in this case. If you want to do that, please modify and use the exported code instead.Anh Tran
KeymasterHi Alex,
If you're using the validation, then you're able to set the error message for each field. So, with specific messages, users will know which field has error and will be able to find it in tabs.
Anh Tran
KeymasterHi Alex and Guy,
As Guy said, it's true that the builder doesn't support custom field types at the moment. We built it with AngularJS and there's some limitation in the code that we couldn't make it possible for developers.
June 24, 2018 at 3:30 PM in reply to: ✅After the Beaver add-on, any chance of an Elementor one? #10334Anh Tran
KeymasterHi, it’s on the plan and I’ll start working on that next month.
June 23, 2018 at 2:24 PM in reply to: Please allow developers to remove the Dashboard from the new Global menu #10326Anh Tran
KeymasterHi Guy, I got it. Let me find the best way to hide/replace the dashboard.
Anh Tran
KeymasterYes, you can do that with the filter, like this:
add_filter( 'rwmb_media_add_string', function( $string ) { $screen = get_current_screen(); return 'page' === $screen->post_type ? '+ New File' : $string; } );Anh Tran
KeymasterHi, this can be done with CSS. Here is a trick to output quick CSS for the field without enqueuing new CSS file:
<?php add_filter( 'rwmb_meta_boxes', function( $meta_boxes ) { $meta_boxes[] = [ 'title' => 'Test Meta Box', 'fields' => [ [ 'type' => 'file_upload', 'id' => 'test', 'name' => 'File Upload', 'after' => '<style>.rwmb-edit-media { display: none; }</style>' ] ], ]; return $meta_boxes; } );Anh Tran
KeymasterHi Guy, I got it. I've just release version 1.5.2 of the Meta Box AIO with a fix for that. Please update!
Anh Tran
KeymasterHi Steven,
I've just resent the email with download link. Can you please check your inbox?
Anh Tran
KeymasterHi Jackky,
There is a workaround on this issue, made by fexy in this topic. Please take a look.
Update: I've improved the clone feature for
postfield. No more extra queries for clones. Please update to the latest version 4.15.0.Anh Tran
KeymasterHi Guy,
The technical difficulty has stopped us from investigating time and effort on doing this feature :(. There's no solution for this yet.
-
AuthorPosts