Forum Replies Created
-
AuthorPosts
-
Peter
ModeratorHello Ryan,
I see the view template works if you select a specific term for the category, tag archive. Let me escalate the issue to the development team to check this and I will get back to you later.
Peter
ModeratorHello Mark,
There is an issue with the context of the custom block in the new version, the custom fields are displayed in the sidebar only. I've escalated this issue to the development team to fix it in the next update.
Thank you.
May 8, 2024 at 10:07 PM in reply to: ✅API::add and error Column 'ID' cannot be null for query INSERT INTO #45407Peter
ModeratorHello,
- If you use the custom table without using the model:
truesetting when creating the table// Step 2: Create a custom table for the model. add_action( 'init', function() { MetaBox\CustomTable\API::create( 'transactions', // Table name. [ // Table columns (without ID). 'created_at' => 'DATETIME', 'amount' => 'BIGINT', 'email' => 'VARCHAR(99)', 'gateway' => 'TEXT', 'status' => 'VARCHAR(20)', 'screenshot' => 'TEXT', ], ['email', 'status'], // List of index keys. true // Must be true for models. ); } );that means you are using the custom table to store the field value of a post type. The ID column of the table is the post ID of the post so it cannot be null when using the
add()function.This is controlled via metabox so i assume there is no pragmatic way to alter this?
There isn't a way to alter this. Can you let me know the benefit of altering this or your specific case?Peter
ModeratorHello,
You can follow the sample code to use the config, same as user_id:
add_action( 'rwmb_profile_after_save_user', function( $user ) { $config = $user->config; if ( 'my-meta-box' === $config['id'] ) { ... } } );If you want to use the filter hook, you need to have a basic knowledge of coding. If you are not familiar with coding, we offer a customization code for an extra fee. Please contact us here for more details https://metabox.io/contact/.
May 7, 2024 at 10:56 PM in reply to: Create a database table on registering a custom post with metabox #45396Peter
ModeratorHello,
1. No, it won't work. As I mentioned above, you have to create the column for the group field, not the subfields in the group.
https://docs.metabox.io/extensions/mb-custom-table/#group-fields2. Yes, you can try to use a loop to register the model for each value in the loop, I've not tested it before. Also note that, the custom table (step 2) can be run at once. That means after the table is created in the database, you don't need to run the code.
Peter
ModeratorHello,
There are some ways to add a custom field to a user (user meta), here is an example of using the action hook
rwmb_profile_after_save_user:add_action( 'rwmb_profile_after_save_user', function( $user ) { $user_id = $user->user_id; update_user_meta( $user_id, 'custom_field_ID', 'custom_field_value' ); } );Please follow the documentation https://developer.wordpress.org/reference/functions/update_user_meta/
https://docs.metabox.io/extensions/mb-user-profile/#rwmb_profile_after_save_userPeter
ModeratorHello Julien,
Thank you for your feedback.
I've shared your idea with the development team to support other JS libraries to get the rendered HTML via Rest API. I will let you know when I have a response from the dev team.
May 7, 2024 at 10:09 PM in reply to: ✅Open Street Map inside Ajax Generated Bootstrap Modal - Displays Empty Container #45393Peter
ModeratorHello,
When a map is rendered, Meta Box loads some script files (CSS, JS) to display the map. The issue is when you call the template via Ajax, the script files aren't loaded and you won't see the map.
Refer to this topic https://wordpress.stackexchange.com/questions/298969/enqueue-script-dinamically
You can try to add some HTML tags like
<script><link rel="stylesheet"in the template and see if it helps. You can find the script files in the filewp-content/plugins/meta-box/inc/fields/osm.php.If you cannot complete the task, we offer a customization service with an extra fee. Please contact us here for more details.
May 6, 2024 at 9:37 PM in reply to: Create a database table on registering a custom post with metabox #45386Peter
ModeratorHello,
I copy your code and run it on the demo site but don't see any errors in the Console log. Please check this screenshot https://imgur.com/tJENfS1
Are you able to create a new entry? Also, you can check the debug log and to see if there is any useful information.
https://developer.wordpress.org/advanced-administration/debug/debug-wordpress/Also, if you use a group field, you have to create one column to save all subfield values to the group field. It won't save the data if you create a column for each subfield. Following the documentation
https://docs.metabox.io/extensions/mb-custom-table/#group-fieldsPeter
ModeratorHello Will,
You can try to follow this tutorial to increase the PHP setting
max_input_varsto fix the issue
https://metabox.io/wordpress-custom-fields-not-saving-increase-max-input-vars/Let me know how it goes.
May 6, 2024 at 9:00 PM in reply to: ✅API::add and error Column 'ID' cannot be null for query INSERT INTO #45384Peter
ModeratorHello Nick,
does it not work for just custom tables without registered models?
Yes, correct. If you want to add a row to a custom table that stores the custom field value of a CPT, not a custom model, you have to pass the post ID ($object_id) to theadd()function.Following the documentation https://docs.metabox.io/extensions/mb-custom-table/#add
Peter
ModeratorHello Rob,
I don't see that error on my demo site. Please try to clear all caches, deactivate all plugins except Meta Box, MB extension plugins, switch to a standard theme of WordPress and check this issue again.
Peter
ModeratorHello there,
What is the package that causes the issue on your project? Please follow some topics below to fix the issue with Composer
https://stackoverflow.com/questions/70285340/composer-package-not-extracting-end-of-central-directory-signature-not-found
https://stackoverflow.com/questions/73948328/error-unzip-end-of-central-directory-signature-not-foundYou can also contact your hosting support and ask them for help with this issue.
Peter
ModeratorHello Artur,
In a field group, if you want to use the Tab field, it must be added first then other fields. Please check this screenshot https://imgur.com/Tb0mxsJ
Peter
ModeratorHello Will,
Can you share the page URL so I can check the issue on my end? Or share some screenshots of the issue on your site.
-
AuthorPosts