Forum Replies Created
-
AuthorPosts
-
Long Nguyen
ModeratorSolved in the new version of MB Tooltip 1.1.4.
Long Nguyen
ModeratorHi,
It's an interesting and rare case. Checking the internet connection while clicking the Publish/Update button maybe avoid this issue.
I'm going to create a feature request for the developer team to cover this case. Thank you.
Long Nguyen
ModeratorHi Peer,
Thank you for paying attention to Meta Box.
Meta Box supports 40+ custom field types and many extensions which help you to control the metadata very well. Could you please let me know what doesn’t work for you? We can help you troubleshoot it.
Long Nguyen
ModeratorHi,
Because only the field
grouphas the keyfieldsin the settings array. So it will display the warning notice likeInvalid argument supplied for foreach(). To solve this issue, you should check if the key exists in the array before using the loop.foreach ( $group1_settings['fields'] as $group1_field_settings ) { if( array_key_exists( 'fields', $group1_field_settings ) ) { foreach ( $group1_field_settings['fields'] as $field_settings ) { ... } } }See more in https://www.php.net/manual/en/function.array-key-exists.php
Long Nguyen
ModeratorNovember 26, 2020 at 9:07 AM in reply to: ✅Displaying related posts in Posts Table Pro (and other solutions) #23069Long Nguyen
ModeratorHi,
Yes, the field
postjust supports selecting post (post types) and save the post ID as the post meta so it does not have the feature reciprocal like the Relationships extension.Long Nguyen
ModeratorHi,
Your code runs smoothly on my local site without any error. If you have an error on any line, print out the variable before using the loop. See https://share.getcloudapp.com/12uKqk4p.
Long Nguyen
ModeratorHi,
The extension MB Group can be installed via Composer. You can get the sample file composer.json here https://github.com/wpmetabox/library/blob/master/composer/composer.json.
Check if the plugin MB Group is loaded before requiring the file vendor.php
if( ! class_exists( 'RWMB_Group' ) ) { require 'meta-box/vendor/autoload.php'; // code goes here }Related topic: https://support.metabox.io/topic/input-values-not-shown-in-back-end/
Long Nguyen
ModeratorHi Kevin,
I've tested your code on my local site but not see any issue. See my screen record https://share.getcloudapp.com/qGul1BqW.
Could you please share some screenshots of the issue on your end? And please make sure that all the Meta Box plugins have the newest version.
Long Nguyen
ModeratorHi Jens,
I've received your staging site information via Freshdesk, there are too many issues in your case to not display the field value with the Oxygen Builder while it should be.
- The custom fields are assigned to the post type Square, not the Page. See https://share.getcloudapp.com/p9urnLy5. Using the helper function rwmb_meta() without the third parameter
$post_idmeans the code will take the current post ID. The Page does not have the custom field => the helper function cannot get the field value. - I do not see the code which creates the custom table in the file functions.php of the theme or a snippet of Code Snippets => the helper function cannot get the field value from the custom table.
- If you create the custom table with other code as well but the code does not create the parameter to pass the value table name.
function acf_picture($mb_field) { $output_array = rwmb_meta($mb_field, ['storage_type' => 'custom_table', 'table' => $wp_square] ); echo $output_array['full_url']; return; }Oxygen does not know what the variable
$wp_squareis when you pass only the field id to the function<?php acf_picture('sq_image_standard'); ?>The snippet should be (fixed table name):
function acf_picture($mb_field) { $output_array = rwmb_meta($mb_field, ['storage_type' => 'custom_table', 'table' => 'wp_square_content'] ); echo $output_array['full_url']; return; }Or dynamic table name:
function acf_picture($mb_field, $wp_square) { $output_array = rwmb_meta($mb_field, ['storage_type' => 'custom_table', 'table' => $wp_square] ); echo $output_array['full_url']; return; }then pass the argument when calling the function
<?php acf_picture('sq_image_standard', 'wp_square_content'); ?>I've removed the setting custom table in the builder to save the field value in the default table of WordPress then the code works as well. You can check the page https://staging.wiconsult.eu/index.php/t02_single-image_php-block/.
Remember the note when creating the custom table https://docs.metabox.io/extensions/mb-custom-table/#notes.
Long Nguyen
ModeratorHi,
The field
postonly supports to save the object ID (post ID) in the database, like the fielduserortaxonomy_advanced. I'm going to create a feature request for the developer team to support saving the slug beside the ID.I think you can use a text or hidden field. Then get the post slug base on the post ID and update slug to the field value text or hidden.
These links will help you to do by coding:
https://docs.metabox.io/rwmb-set-meta/
https://stackoverflow.com/questions/33842251/how-to-get-post-slug-from-post-in-wordpressLong Nguyen
ModeratorHi Cinza,
It looks like the select field, not select_advanced (default). Please deactivate all plugins except Meta Box, MB extensions and switch to the default theme of WordPress Twenty Twenty to check the issue again. If it does not solve, I recommend checking your code, it might use the field type select.
You can also get connections with posts that have other statuses (draft, pending, private...) by using the setting
query_args.The code would be:
'from' => 'CPT', 'to' => array( 'post_type' => 'CPT', 'field' => array( 'field_type' => 'select' //Check the field type here ), 'query_args' => array( 'post_status' => array( 'pending', 'draft', 'private' ) ), ),See more in the documentation:
https://developer.wordpress.org/reference/classes/wp_query/#status-parameters
https://docs.metabox.io/extensions/mb-relationships/#syntaxNovember 23, 2020 at 9:47 PM in reply to: ✅Displaying related posts in Posts Table Pro (and other solutions) #22997Long Nguyen
ModeratorHi there,
Meta Box supports the field
postwhich similar to the Relationships extension. The difference is it saves the post ID in the database as the post meta like other fields. Please try to use it with the plugin Posts Table Pro.See more in this documentation https://docs.metabox.io/fields/post/.
Long Nguyen
ModeratorHi,
The plugin MB Relationships has not supported to link to the post selected on the backend yet. I'm going to create a feature request for the developer team to support this case.
Thank you.
Long Nguyen
ModeratorHi,
The field
postsave the post ID in the database so you can use the function get_the_permalink() to get the link of the post ID. It just likes the sample code https://docs.metabox.io/fields/post/#template-usage. - The custom fields are assigned to the post type Square, not the Page. See https://share.getcloudapp.com/p9urnLy5. Using the helper function rwmb_meta() without the third parameter
-
AuthorPosts