Forum Replies Created
-
AuthorPosts
-
Peter
ModeratorHello,
You can ask WooCommerce support for providing a way to hide those default fields in the admin area and create the same field IDs with Meta Box to save to the database.
If you are not able to complete the task, please contact us here https://metabox.io/contact/
our development team will help you with an extra fee.Peter
ModeratorHello,
Use the function
print_r()to know the data structure of the field settings. You will need to have a basic knowledge of coding to echo the choice. For example:$field = rwmb_get_field_settings( 'city', '', 123 ); // 123 is the post ID $field_choices = $field['options']; foreach ($field_choices as $value => $label) { echo "Value: " . $value; echo "<br />"; echo "Label: " . $label; echo "<br />"; }If you are not able to complete the task, please contact us here https://metabox.io/contact/
our development team will help you with an extra fee.Peter
ModeratorHello,
Meta Box does not support changing the CPT slug from a custom field. You might need to use a custom code to do that. Refer to this topic https://wordpress.stackexchange.com/questions/41988/redeclare-change-slug-of-a-plugins-custom-post-type
Peter
ModeratorHello,
You should add the code to the template of the listing post to get the current post ID. If not you need to pass the post ID to the function. And the return value is an array so you need to use the function
var_dump()orprint_r()to print out the value.For example:
$field = rwmb_get_field_settings( 'city', '', 123 ); // 123 is the post ID echo '<pre>'; print_r( $field ); echo '</pre>';Peter
ModeratorHello,
Thanks for your feedback.
I've escalated this issue to the development team to fix it. I will let you know when I have any information.
Peter
ModeratorHello,
Currently, it is not possible. You will need to edit the post to upload the file and attach it to the post, like in the admin area.
July 31, 2023 at 8:32 PM in reply to: The auto created relationship has an extra taxonomy in it? #42784Peter
ModeratorHello,
Thanks for your feedback.
It is redundant, I will inform the development team to remove it when generating PHP code.
July 31, 2023 at 7:38 PM in reply to: Custom Post Type: "Quick Edit" changes the owner to the current logged in user #42782Peter
ModeratorHello,
I do not see that issue on my demo site. You can go to Meta Box > Post Types > Edit the CPT > Support tab > Enable "Author" option.
Then when clicking on Quick Edit, make sure the correct author is selected and Publish it. Screenshot https://imgur.com/dYxiPb1
July 31, 2023 at 5:42 PM in reply to: ✅Single Image in settings page to be added to a page or post custom field. #42781Peter
ModeratorHello,
Follow the WordPress documentation https://developer.wordpress.org/reference/functions/update_post_meta/
you have to pass the post/page ID to the functionupdate_post_meta()to update the field value (post meta) for a post/page.If you want to update that value for all posts/pages, please create a custom WP query to get posts/pages and use the function
update_post_meta()in the loop. You can read more about WP query here https://developer.wordpress.org/reference/classes/wp_query/July 30, 2023 at 10:39 PM in reply to: ✅Single Image in settings page to be added to a page or post custom field. #42776Peter
ModeratorThere are two issues on your site:
1. The code is added inside an
ifstatement and the condition is not true so the code is not executed. Screenshot https://imgur.com/bSTMLbH2. The field group Location Details has the field ID prefix
location_detailsso the fieldimage_of_town_1in this field group has the correct IDlocation_detailsimage_of_town_1. The code should beif ( $field['id'] == 'location_detailsimage_of_town_1' && is_admin() ) {I fixed those issues on your site and now it works fine.
July 30, 2023 at 3:42 PM in reply to: ✅Single Image in settings page to be added to a page or post custom field. #42774Peter
ModeratorHello,
Please share your site admin account via this contact form https://metabox.io/contact/
I will take a closer look.July 28, 2023 at 10:29 PM in reply to: ✅Single Image in settings page to be added to a page or post custom field. #42771Peter
ModeratorHello,
The code works fine on my local site, here is the screen record https://drive.google.com/file/d/1mdEJhBQdb5XB6xik_fEsR0ymQP5DPwFa/view?usp=sharing
You can try to add the code to the file functions.php in the theme/child theme folder and deactivate all other plugins except Meta Box, MB plugins to see if it works.
July 28, 2023 at 9:13 PM in reply to: Field values not loading for specific Field group on posts #42770Peter
ModeratorStrange. Please share your site credentials via this contact form https://metabox.io/contact/
I will take a closer look.Peter
ModeratorHello,
Can you please share some screenshots of the capabilities for the custom role? Or you can try to contact User Role Editor support to get more information.
July 27, 2023 at 9:08 PM in reply to: ✅Dynamically populate the options of a select custom field, base on global CF #42765Peter
ModeratorHello,
It is possible. You can create a custom callback function to get the settings page value and return an array of values and labels. For example:
add_filter( 'rwmb_meta_boxes', 'your_prefix_function_name' ); function your_prefix_function_name( $meta_boxes ) { $meta_boxes[] = [ 'title' => __( 'My Custom Fields', 'your-text-domain' ), 'id' => 'my-custom-fields', 'fields' => [ [ 'type' => 'select_advanced', 'name' => esc_html__( 'Supervisor', 'apms' ), 'id' => 'supervisor_id', 'options' => my_func9999(), ] ], ]; return $meta_boxes; } function my_func9999() { $settings_page = get_option( 'option_name' ); // do your stuff return [ 'a' => 'A', 1 => 1, 2 => 2, 'b' => 'B' ]; } -
AuthorPosts