Forum Replies Created
-
AuthorPosts
-
Long Nguyen
ModeratorHi Dave,
If you are using the custom table to save the value, please use this code to get the value
$value = rwmb_meta( $field_id, ['storage_type' => 'custom_table', 'table' => $table_name] ); echo $value;and regarding the Oembed type, you can use the function
rwmb_the_value()which outputs the HTML of the field.For further information, please follow the documentation
https://docs.metabox.io/extensions/mb-custom-table/#getting-field-value
https://docs.metabox.io/rwmb-the-value/Long Nguyen
ModeratorHi,
I'm following this documentation to create a settings page name "Pencil" and a field "Heading Color". The settings page is saved in
wp_optionstable so when you click update/submit your custom form, you can trigger this code to update the option (field value) in the settings pageadd_action( 'admin_init', function() { $option = get_option( 'pencil' ); $option['heading-color'] = '#fff'; update_option('pencil', $option); } );Hope that matches your idea.
Long Nguyen
ModeratorHi,
Hope you are well today.
I've opened an issue for the developer team to fix this problem in the next update as soon as possible. At this time, please use the form submit without the Ajax option for a better experience.
Thanks for your patience.
April 14, 2020 at 10:06 PM in reply to: ✅Custom post types or taxonomies not showing in MB View #19032Long Nguyen
ModeratorHi Sandra,
By default, all the post fields will show on the tab Post, see my screenshots
https://cl.ly/e923f9b77fd5
https://cl.ly/53485a259d05Could you please clear the cache and check the Insert Field again? Or take some screenshots in your end.
Long Nguyen
ModeratorHi,
The Meta Box plugin only supports to create the fields for the posts, pages, CPT, user, and the settings page which is created by MB Settings Page extension. You are right when creating the Settings page, this is the better way to let the owner import their information just like the Site title, logo ...
Long Nguyen
ModeratorHi there,
The extension MB Frontend Submission helps you to create a form which let user can submit their post on the frontend. You can create a meta box with the fields business, website ... and show the form on the frontend with the shortcode
[mb_frontend_form id="meta-box-id" post_fields="title,content"]then the user can submit their post include the business, website and post data.
For more information, please follow our documentation
https://docs.metabox.io/extensions/mb-frontend-submission/Long Nguyen
ModeratorHi,
Thank you for the idea but I think no need to add the parameter
capabilitiesbecause each role has its own capabilities and you can add a capability to a role easily with the functionadd_cap()For more information, please follow the documentation
https://docs.metabox.io/extensions/mb-user-profile/#upload-files--images
https://wordpress.org/support/article/roles-and-capabilities/Long Nguyen
ModeratorHi Michael,
MB Views only help you to get Meta Box fields and build your templates on the front end. If you want to create your own admin tables, please follow this article to know how to do with the coding
https://premium.wpmudev.org/blog/wordpress-admin-tables/Long Nguyen
ModeratorHi,
Please change the variable
$idto$form['id']. To know all the properties of the form, you can use the functionvar_dump($form)to print it out.Long Nguyen
ModeratorHi there,
These things are custom code so you should hire a developer to create a filter like Facet and Meta Box integrator.
Let me know if you have any questions.
Long Nguyen
ModeratorHi,
Sorry, it saves the value but not show the selected option, I've changed code to show the selected form
add_action( 'init', function() { if ( class_exists( 'RWMB_Field' ) ) { class RWMB_GForm_Select_Field extends RWMB_Field { public static function html( $meta, $field ) { $forms = GFAPI::get_forms(); // Get saved form ID $post_id = filter_input( INPUT_GET, 'post', FILTER_SANITIZE_NUMBER_INT ); $saved_form = rwmb_get_value( 'gform_select', '', $post_id ); $html = ''; $html .= '<label for="' . $field['id'] . '">Choose a form:</label> <select id="' . $field['id'] . '" name="' . $field['field_name'] . '">'; foreach ( $forms as $id => $form ) { if( $saved_form == $id ) { $html .= '<option value="' . $id . '" selected >' . $form['title'] . '</option>'; } else { $html .= '<option value="' . $id . '">' . $form['title'] . '</option>'; } } $html .= '</select>'; return $html; } } } } );Please check it out.
Long Nguyen
ModeratorHi Mauro,
The extension MB Blocks supports to show the image on the preview block area, please follow the documentation and see my screenshot.
Remember to create the property name as the same as the field ID and the preview area will render the template of the block with the preview value.
Long Nguyen
ModeratorHi,
You can try to put the body tag before the class to override the CSS code of the MB plugin
body .rwmb-label, body .rwmb-label ~ .rwmb-input { width: 100%; }then clear the cache and check it again.
Long Nguyen
ModeratorHi Benj,
You can try to deactivate all plugins except MB plugins and switch to the default theme of WordPress (Twenty Twenty) to submit the form again. Then activate plugins one by one and switch to the current theme (SELA), this way could help you know where the problem comes from.
April 11, 2020 at 12:35 PM in reply to: ✅Is it possible to use the custom table to save all general post information? #18984Long Nguyen
ModeratorHi,
Yes, I know the question you are talking about. You can follow this guide to know how to save the post data to another table
https://stackoverflow.com/questions/49439231/wordpress-inserting-posts-in-another-custom-table
https://wordpress.stackexchange.com/questions/145699/let-posts-be-stored-in-another-tableYou may have to spend a few times to create the code and make it run smoothly. By creating the fields to import the content as the post data is easier and saves a lot of time.
-
AuthorPosts