Forum Replies Created
-
AuthorPosts
-
Long Nguyen
ModeratorHi Brian,
Can you please share the slug of the CPT? And please try to deactivate all plugins except Meta Box, MB extensions, switch to the standard theme of WordPress, and re-save the permalink settings.
Long Nguyen
ModeratorHi,
It's a cloneable group, then you need to create a loop to iterate through an array of groups.
add_shortcode( 'references', function() { $groups = rwmb_meta( 'references' ); //return $groups; if ( empty( $groups ) ) { return ''; } $output = ''; foreach ( $groups as $group ) { // Reference URL $rlabel = $group['myreference_label'] ?? ''; $rurl = $group['myreference_url'] ?? ''; $output .= '<a href="' . $rurl . '">' . $rlabel . '</a>'; } return $output; } );Read more on the documentation https://docs.metabox.io/extensions/meta-box-group/#getting-sub-field-values
Long Nguyen
ModeratorHi,
If you use the helper function to get images from the custom field, no need to attach the image to a post because this option works like a custom field with the meta key
_wp_attached_file.Long Nguyen
ModeratorHi,
The function
add_post_meta()works as well on my local site, please check this screen record https://monosnap.com/file/XPzx3xXkAdjR6wQU9otZGdqI0g7bbuCode:
add_action( 'init', function() { add_post_meta( 2192, 'image_advanced_v4mq8tny1nh', 2484, false ); add_post_meta( 2192, 'image_advanced_v4mq8tny1nh', 2483, false ); add_post_meta( 2192, 'image_advanced_v4mq8tny1nh', 2481, false ); }, 99 );May 5, 2022 at 12:23 PM in reply to: Query Args don't work the same for Relationships and Post fields #35896Long Nguyen
ModeratorHi,
There is an issue with the setting
query_argsof the relationship, it is fixed in this commit https://github.com/wpmetabox/mb-relationships/commit/7e9505be0b3fc2ac69a1fc1ffba714cb4ede41f8You can download this branch to your site and follow the documentation to use the query_args with coding
https://docs.metabox.io/extensions/mb-relationships/#using-codeLet me know how it goes.
Long Nguyen
ModeratorHi David,
Can you please share the code that creates the group and subfields? If you are using the builder, please refer to this documentation https://docs.metabox.io/extensions/meta-box-builder/#getting-php-code
Long Nguyen
ModeratorHi David,
Before outputting the field value, you can use the code to check if the user logged in or not or check the user role ...
if ( is_user_logged_in() ) { echo rwmb_meta( 'field_id' ); } else { echo 'Welcome, visitor!'; }Read more on the documentation https://developer.wordpress.org/reference/functions/is_user_logged_in/
Long Nguyen
ModeratorHi,
The posts on the frontend are sorted by the order on the backend. Please try to deactivate all plugins except Meta Box, MB extensions, and switch to the standard theme of WordPress (Twenty TwentyTwo) then re-check this issue.
Long Nguyen
ModeratorHi,
Thanks for your feedback.
I will inform the development team to consider improving the field
telto support this case.Long Nguyen
ModeratorHi,
Please follow this documentation to know how to add more subfield values to the group title. Remember to enable the setting
collapsibleof the group field.
https://docs.metabox.io/extensions/meta-box-group/#collapsible-groupsLong Nguyen
ModeratorHi,
MB User Profile extension has not had an option to force users to change the password for the first login. I will inform the development team to explore the possibility.
Long Nguyen
ModeratorHi Dragos,
You can use the function
add_post_meta()to add more value to a post with the same meta key (field ID). Read more on the documentation https://developer.wordpress.org/reference/functions/add_post_meta/
https://docs.metabox.io/fields/image-advanced/#dataLong Nguyen
ModeratorHi,
Submitting a post without logging in is not the main aim of this extension. I will inform the development team to consider supporting an attribute for the shortcode to allow visitors to submit posts. For now, you can use another reviews plugin to collect reviews on your site.
Long Nguyen
ModeratorHi,
Can you please share some screenshots of the order of teams in the backend and on the frontend?
Long Nguyen
ModeratorHi Austin,
The field
postuse the filterposts_searchto search posts by title. You can also create a custom callback function to search by post meta. Please check the source code below
https://github.com/wpmetabox/meta-box/blob/master/inc/fields/post.php#L154
https://github.com/wpmetabox/meta-box/blob/master/inc/fields/post.php#L181-L201 -
AuthorPosts