Forum Replies Created
-
AuthorPosts
-
Peter
ModeratorHello,
I've tried to run the code on my local site and see there are two issues:
- You should run the callback function with a higher priority like 99
add_filter('mbct_import_column_output', 'bcc_modify_title_column_output', 99, 4);- You should return the HTML code instead of printing it out, because in the WordPress list table function, it is outputted by using
echostate. Please check the filewp-admin/includes/class-wp-list-table.phpline 1532. It should be:// Make the title a link to the 'edit' page. $output = '<a href="' . esc_url($edit_url) . '">' . $output . '</a>';Let me know how it goes.
Peter
ModeratorHello,
Yes, there is a way. Please enable the collapsible setting of the group field and set the default state Collapsed. Please read more on the documentation https://docs.metabox.io/extensions/meta-box-group/#settings
March 18, 2023 at 6:54 PM in reply to: ✅Meta Box in Bricks Builder - Use MB Field Group on another page #41088Peter
ModeratorHello,
If the Bricks builder supports using the PHP code, you can use the helper function
rwmb_meta()to get a field value from a specific page/post by passing the post ID to the third parameter. Please read more on the documentation https://docs.metabox.io/functions/rwmb-meta/March 18, 2023 at 6:38 PM in reply to: ✅Excluding the current post in reciprocal relationships #41087Peter
ModeratorHell Tom,
I see the issue. In this case, you will need to use the code to register the relationship and use the query args to exclude the current post from the list of posts.
add_action( 'mb_relationships_init', 'callback_function' ); function callback_function() { $post_id = null; if ( isset( $_GET['post'] ) ) { $post_id = intval( $_GET['post'] ); } elseif ( isset( $_POST['post_ID'] ) ) { $post_id = intval( $_POST['post_ID'] ); } MB_Relationships_API::register( [ 'id' => 'post-to-post', 'reciprocal' => true, 'from' => [ 'object_type' => 'post', 'post_type' => 'post', 'meta_box' => [ 'context' => 'normal', ], ], 'to' => [ 'object_type' => 'post', 'post_type' => 'post', 'meta_box' => [ 'context' => 'normal', ], 'field' => [ 'query_args' => [ 'post__not_in' => [ $post_id ], // here ], ], ], ] ); }March 18, 2023 at 6:23 PM in reply to: MB custom fields and WP Gridbuilder data issue on filter facet #41086Peter
ModeratorHello,
I do not see the sample post ID
123is replaced when you use the code. According to your screen record, the post ID is424. Can you please try to use the code again?$number = rwmb_meta( 'price', '', 424 );Please check this screenshot https://monosnap.com/file/09JInc0QAK7R5gpdB4gNMSgZ1f3q0g
Peter
ModeratorHello,
What Meta Box does, in this case, is to support the UI to register the post type with the WordPress function
register_post_type()instead of using the code.
https://developer.wordpress.org/reference/functions/register_post_type/If you want to check the issue, you can register some CPTs with the code and with your plugins and with non-plugins activated on a staging site to see how it goes. It's not possible to check a conflict with any plugins on the internet and it is also beyond our scope of support of Meta Box which you can read more here https://support.metabox.io/topic/support-policy/
I hope that makes sense.
Peter
ModeratorHello,
The field
image_uploaddoes not work with the non-logged in users. Instead, please use the fieldimage, read more on the documentation https://docs.metabox.io/fields/image/March 18, 2023 at 5:38 PM in reply to: ✅[Bug]: Incorrect URL When Setting Parent Menu Of Settings Page To Custom Model #41083Peter
ModeratorHello,
Thanks for your feedback.
I can see the issue on my demo site and I've escalated this issue to the development team to fix it in the next update.
Peter
ModeratorHello,
I cannot give you the ETA but this feature is in the backlog development and the development team will work on it in future updates.
Thanks.
Peter
ModeratorHello,
Yes, the idea is to use the JS validation to validate the field without reloading the page. If the page is reloaded, the input value will be lost if it does not pass the backend validation.
March 17, 2023 at 10:26 PM in reply to: MB custom fields and WP Gridbuilder data issue on filter facet #41068Peter
ModeratorHello,
That code outputs the number formatted as well on my demo site. You can try to pass the post ID to the third parameter of the helper function.
$number = rwmb_meta( 'price', '', 123 );where 123 is the post ID. Please read more on the documentation https://docs.metabox.io/functions/rwmb-meta/
March 17, 2023 at 10:06 PM in reply to: ✅Excluding the current post in reciprocal relationships #41067Peter
ModeratorHello,
The setting
reciprocalof the relationship helps you to prevent connecting the current post to itself. Please read more on the documentation https://docs.metabox.io/extensions/mb-relationships/#relationship-settingsPeter
ModeratorHello Sam,
There is a trick to sort the posts by modified date. You can create a custom field date_picker and create an admin column to display this field value and sortable, then use the WordPress function
get_the_modified_date()to get the modified date and update this data for the field.This is the example code:
add_action( 'save_post', function( $post_id ) { $modified_date = get_the_modified_date( '', $post_id ); update_post_meta( $post_id, 'date_field', $modified_date ); } );You might need to check the post type or something else on your end. Please read more on the documentation
https://developer.wordpress.org/reference/functions/get_the_modified_date/
https://docs.metabox.io/extensions/mb-admin-columns/#3-advanced-configurationPeter
ModeratorHello Sam,
Let me answer your questions.
1. The post content revision is the standard feature of WordPress, it does not relate to Meta Box itself.
2. Yes, I see the issue on my end. I've escalated this to the development team to check this and get back to you later.
Peter
ModeratorHello,
The menu position works correctly on my local site. But it can be modified by any plugin or theme on your site which also use the WordPress hook to add its menu and can rearrange the position then.
You can try to deactivate all plugins and leave Meta Box, MB AIO activate and switch to a standard theme of WordPress then check this issue again.
You can also read more about the default menu structure number here https://developer.wordpress.org/reference/functions/add_menu_page/#menu-structure
-
AuthorPosts