Forum Replies Created
-
AuthorPosts
-
January 22, 2022 at 9:08 AM in reply to: Fatal error from trying to create table using the API #33389
Long Nguyen
ModeratorHi,
Thanks for your feedback.
Please downgrade the PHP version to 7.4 and re-create the custom table. Let me know if it works.
Refer to this post https://www.facebook.com/groups/metaboxusers/posts/996154814335496/
Long Nguyen
ModeratorHi,
You can create a name or email field, mark it required, and include this value in the email content.
Long Nguyen
ModeratorHi guys,
Please update Meta Box AIO to the latest version 1.15.5 to fix this issue.
Long Nguyen
ModeratorHi,
Thanks for your additional information.
- Regarding the
wysiwygfield under the post typeresources, I see that issue. Thewysiwygfield is not working properly as a subfield in a group. I will inform the development team to check and fix this. -
Regarding the
wysiwygfield under the post typefaq, the field ID must not include the special characters. Should be only numbers, letters, and underscores (and rarely dashes).
[ 'name' => __( 'FAQ: Answer', 'your-text-domain' ), 'id' => $prefix . 'faq_answer', 'type' => 'wysiwyg', ]Refer to this documentation https://docs.metabox.io/field-settings/#general
Long Nguyen
ModeratorHi,
If you use the
checkboxfield, the value submitted is1or0. So you should compare it with this value.$value = empty( $_POST['submit_form_for_review'] ) ? null : $_POST['submit_form_for_review']; if ( $value == 1 ) { ... }Refer to this documentation https://docs.metabox.io/fields/checkbox/#template-usage
Long Nguyen
ModeratorHi Bellul,
You need to get the post terms based on the post ID first, then use the
forloop to iterate each term to get the term ID. For example:{% for report in reports %} <p><a href="{{ mb.get_permalink( report.ID ) }}">{{ report.post_title }}</a></p> {% set my_post_terms = mb.wp_get_post_terms( report.ID, 'taxonomy_slug' ) %} {% for my_term in my_post_terms %} {{ mb.rwmb_meta( 'kb_year', {'object_type': 'term'}, my_term.term_id ) }} {% endfor %} {% endfor %}Refer to the documentation https://developer.wordpress.org/reference/functions/wp_get_post_terms/
Long Nguyen
ModeratorHi Lionel,
Can you please share the code that creates the fields on your site? And please make sure that you have the latest version of Meta Box 5.5.1, MB Columns 1.2.14.
Long Nguyen
ModeratorHi Kyle,
Yes, it is possible. But you need to use the function get_option() to get settings page value when registering the field.
Refer to this topic https://support.metabox.io/topic/code-not-working-with-updated-version/
Long Nguyen
ModeratorHi,
It is not possible to show only uploaded files on the frontend dashboard. The uploaded files are the post meta, associated with the posts. You can create a custom query to retrieve all posts then get and show the file (post meta) only on the user account page.
Refer to the documentation
https://developer.wordpress.org/reference/classes/wp_query/
https://docs.metabox.io/fields/file-upload/#template-usageLong Nguyen
ModeratorHi,
After submitting the form, does the function
wp_safe_redirect()work, redirect to the review page? If yes, the functionwp_mail()is not working due to some problem with SMTP on your hosting. You can contact your hosting support to fix this issue.Refer to this note in the WP documentation
https://developer.wordpress.org/reference/functions/wp_mail/#notesLong Nguyen
ModeratorHi,
Yes, this issue has been fixed in the new version 1.10.0. You can read the changelog of all extensions by clicking the number of versions on the My Account page. Screenshot https://monosnap.com/file/78KQ1O5dcZXX13umxGX4CAp1mZUoOa
Long Nguyen
ModeratorHi Alisha,
Can you please share the code that creates the fields on your site? Refer to this documentation to generate PHP code https://docs.metabox.io/extensions/meta-box-builder/#getting-php-code
Long Nguyen
ModeratorHi,
If you want to check the table existed, please refer to this topic https://wordpress.stackexchange.com/questions/11641/checking-if-database-table-exists
This extension helps you to save the post meta to the custom table, so you can hook to some actions that support using the post ID to pass to the API like
save_post
https://developer.wordpress.org/reference/hooks/save_post/For example:
add_action( 'save_post', 'my_function', 10,3 ); function my_function( $post_id, $post, $update ) { $data = [ 'field_1' => 'value 1', 'field_2' => 'value 2', 'field 3' => ['one', 'two', 'three'], ]; \MetaBox\CustomTable\API::add( $post_id, 'table_name', $data ); }Long Nguyen
ModeratorHi Rodrigo,
Is it possible to create entries in a CPT from multiple forms?
No, it's not possible. You can create more field groups, assign them to one post type. Then put all field group IDs into one form. Like this[mb_frontend_form id="meta-box-id1,meta-box-id2,meta-box-id3" post_fields="title,content"]Refer to the documentation https://docs.metabox.io/extensions/mb-frontend-submission/#shortcode-attributes
Long Nguyen
ModeratorHi,
It is possible. You can check the field value via the global variable
$_POSTand use the form action hookrwmb_frontend_after_processto send the email after the user submits the form.add_action( 'rwmb_frontend_after_process', function( $config, $post_id ) { $value = empty( $_POST['field_id'] ) ? null : $_POST['field_id']; if ( 'yes' === $value ) { wp_mail( '[email protected]', 'New submission', 'A new post has been just submitted.' ); wp_safe_redirect( 'thank-you' ); die; } }, 10, 2 );Refer to the documentation https://docs.metabox.io/extensions/mb-frontend-submission/#form-actions
- Regarding the
-
AuthorPosts