Forum Replies Created
-
AuthorPosts
-
November 5, 2021 at 7:26 PM in reply to: ✅Conflict using multiple taxonomy advanced fields in same block #31753
Long Nguyen
ModeratorHi,
I do not see any issue with your code on my end. Screen record https://share.getcloudapp.com/7KuAE2Yy
The code which I tested on the local site
add_filter( 'rwmb_meta_boxes', 'your_prefix_function_name' ); function your_prefix_function_name( $meta_boxes ) { $prefix = ''; $meta_boxes[] = [ 'title' => __( 'Featured Content', 'your-text-domain' ), 'id' => 'featured-content', 'description' => 'Displays featured content on the homepage.', 'icon' => 'star-filled', 'category' => 'theme', 'keywords' => ['featured'], 'supports' => [ 'align' => ['full'], ], 'render_callback' => 'my_callback', 'type' => 'block', 'context' => 'side', 'fields' => [ [ 'name' => __( 'Content Population', 'your-text-domain' ), 'id' => $prefix . 'content_population', 'type' => 'select', 'options' => [ 'auto' => __( 'Auto-populate by category', 'your-text-domain' ), 'manual' => __( 'Manually populate', 'your-text-domain' ), ], 'std' => 'autopopulate', 'required' => true, ], [ 'name' => __( 'Fallback Category', 'your-text-domain' ), 'id' => $prefix . 'fallback_category', 'type' => 'taxonomy_advanced', 'label_description' => __( 'Select a fallback category for when there are not enough posts.', 'your-text-domain' ), 'taxonomy' => ['category'], 'field_type' => 'select_advanced', 'required' => true, ], [ 'name' => __( 'Category Source', 'your-text-domain' ), 'id' => $prefix . 'category_source', 'type' => 'select', 'options' => [ 'singlelocal' => __( 'Single Local Category', 'your-text-domain' ), 'multiplelocal' => __( 'Multiple Local Categories', 'your-text-domain' ), 'syndicated' => __( 'Syndicated Category', 'your-text-domain' ), ], 'std' => 'singlelocal', 'visible' => [ 'when' => [['content_population', '=', 'auto']], 'relation' => 'or', ], ], [ 'name' => __( 'Autopopulated Single Category', 'your-text-domain' ), 'id' => $prefix . 'autopopulated_single_category', 'type' => 'taxonomy_advanced', 'taxonomy' => ['category'], 'field_type' => 'select_advanced', 'visible' => [ 'when' => [['category_source', '=', 'singlelocal']], 'relation' => 'or', ], ], [ 'name' => __( 'Autopopulated Categories', 'your-text-domain' ), 'id' => $prefix . 'autopopulated_categories', 'type' => 'taxonomy_advanced', 'taxonomy' => ['category'], 'field_type' => 'select_advanced', 'multiple' => true, 'visible' => [ 'when' => [['category_source', '=', 'multiplelocal']], 'relation' => 'or', ], ], ], ]; return $meta_boxes; } function my_callback( $attributes, $is_preview = false, $post_id = null ) { // Fields data. if ( empty( $attributes['data'] ) ) { return; } mb_the_block_field( 'fallback_category' ); echo '<br>'; mb_the_block_field( 'autopopulated_single_category' ); }November 5, 2021 at 12:20 PM in reply to: Gravity Form Advanced Post Creation and MB Custom Table #31746Long Nguyen
ModeratorHi,
A small problem is: the 1st time I run the script, it moved 1 record; the 2nd time => 2 records and so on... but what happen if I would have 100000 records?
When you run the script, it will move all post meta of a post type from the table wp_postmeta to the custom table. Please read more here
https://metabox.io/move-custom-fields-data-to-custom-tables/#step-2-move-the-data-to-the-new-custom-tableSo, is it possible to create custom post from GF post creation plugin (and other 3rd post creation plugin) that automatically store data In metabox custom table?
I think it is not possible. GF form only supports storing custom field values in the standard table of WordPress
wp_postmeta. You can contact GF form support to ask for help with this case.November 5, 2021 at 8:01 AM in reply to: frontend submission form for a cloneable field, only add! #31744Long Nguyen
ModeratorHi Steffen,
Do you mean to add new cloneable items and hide all previous cloneable items in the form? If yes, it is not possible. You might want to use the feature of MB Group that supports collapsing/expanding the group.
https://docs.metabox.io/extensions/meta-box-group/#collapsible-groupsLong Nguyen
ModeratorHi,
I've also experienced that issue on my in a while. If you cannot select a specific post, that means the view is broken. Screenshot https://share.getcloudapp.com/nOu5P549
You can try to create a new View and select the Location again. If you can select a specific post, the view will render the content as well. Screenshot https://share.getcloudapp.com/JrunDnRP
Long Nguyen
ModeratorHi Kara,
You should use the choice value in lower case.
[ 'name' => __( 'Save As', 'your-text-domain' ), 'id' => $prefix . 'save_as', 'type' => 'radio', 'options' => [ 'draft' => __( 'Draft', 'your-text-domain' ), 'publish' => __( 'Publish', 'your-text-domain' ), ], 'std' => 'draft', 'required' => true, 'inline' => false, ],And the code to update the post status is
add_action( 'rwmb_save_as_after_save_field', function( $null = true, $field, $new, $old, $object_id ) { $my_post = array( 'ID' => $object_id, 'post_status' => $new, ); wp_update_post( $my_post ); }, 10, 5 );Long Nguyen
ModeratorHi Matt,
Please try to re-save the permalink (Post name) then check the Site Health status in Tools > Site Health if there is an error message with REST API. Some screenshots would be appreciated.
Long Nguyen
ModeratorHi,
FYI, the MB Views plugin runs Twig functions/classes under the namespace
MBViews. Please contact Timber plugin support to ask for help with this issue.Long Nguyen
ModeratorHi David,
You can register a new image size name then pass the size name to the function as the second argument. Please read more on WordPress documentation
https://developer.wordpress.org/reference/functions/get_the_post_thumbnail/
https://developer.wordpress.org/reference/functions/add_image_size/{{ mb.get_the_post_thumbnail( post.ID, 'custom-size' ) }}November 3, 2021 at 9:47 PM in reply to: ✅Add Post ID to Custom Field And Then to Admin Column #31717Long Nguyen
ModeratorHi,
Just replace
fieldIDby your field IDpro_new_idadd_action( 'rwmb_pro_new_id_after_save_field', function ( $null, $field, $new, $old, $post_id ) { $storage = $field['storage']; $storage->update( $post_id, $field['id'], $post_id ); }, 10, 5 );November 3, 2021 at 9:03 AM in reply to: ✅allow_delete="false" is set but delete is still visible and working #31711Long Nguyen
ModeratorHi,
The parameter
allow_deletesupports displaying a button "Delete" on the frontend submit page. On the dashboard page, the user will have full control over the post Edit or Delete.Please read more here https://docs.metabox.io/extensions/mb-frontend-submission/#shortcode-attributes
November 3, 2021 at 8:50 AM in reply to: ✅Add Post ID to Custom Field And Then to Admin Column #31709Long Nguyen
ModeratorHi Janos,
You can create a
textfield, enable show in admin columns, then use the action hookrwmb_{$field_id}_after_save_fieldto update the field value by post ID. For example:add_action( 'rwmb_fieldID_after_save_field', function ( $null, $field, $new, $old, $post_id ) { $storage = $field['storage']; $storage->update( $post_id, $field['id'], $post_id ); }, 10, 5 );Refer to this documentation https://docs.metabox.io/actions/#rwmb_after_save_field
Long Nguyen
ModeratorHi,
It is called block alignment, but MB Blocks has not had an option to set the default alignment yet. I will inform the development team to support this in future updates.
November 2, 2021 at 7:53 PM in reply to: ✅Field Advanced and automatically "attach" uploaded file (e.g. pdf) #31702Long Nguyen
ModeratorHere you go https://share.getcloudapp.com/yAu06Kb4
I've tested to create a new post (CPT), upload the PDF file, and publish the post. There is no issue like that. You can try to deactivate all plugins except Meta Box, switch to the standard theme of WordPress, and re-check this issue.
November 2, 2021 at 3:36 PM in reply to: Post field: how to filter posts of certain categories? #31696Long Nguyen
ModeratorHi,
You can use the setting
query_argsto filter posts by taxonomy as well. Please read more on the documentation
https://docs.metabox.io/fields/post/#settings
https://developer.wordpress.org/reference/classes/wp_query/#taxonomy-parametersNovember 2, 2021 at 10:59 AM in reply to: ✅Field Advanced and automatically "attach" uploaded file (e.g. pdf) #31690Long Nguyen
ModeratorHi,
I do not see any issue on my end, screen record https://share.getcloudapp.com/z8u1PYAO
But after saving the post and reloading the page, you see the file icon still available in the field that means the value is saved to the database. Don't worry about the attached option of WordPress.
You can also follow the documentation to output the field value to make sure it works https://docs.metabox.io/fields/file-advanced/#template-usage
-
AuthorPosts