Forum Replies Created
-
AuthorPosts
-
Long Nguyen
ModeratorHi,
Sorry, forget to mention. The Rest API error shows after switching permalink settings to "Post name".
March 21, 2021 at 8:54 PM in reply to: ✅User query for timestamp in meta array whne less than today's date #26565Long Nguyen
ModeratorHi Scott,
Follow the class WP_User_Query documentation, to query users by custom field, the key
product_datashould bemeta_key. And you do not need to wrap the variable $theDate in the single quote.Get more details on this documentation https://developer.wordpress.org/reference/classes/wp_user_query/#custom-field-parameters.
Long Nguyen
ModeratorHi Maria,
Please follow this topic on StackOverFlow to get multi-lines for textarea placeholder https://stackoverflow.com/questions/7189223/can-you-have-multiline-html5-placeholder-text-in-a-textarea
JS
var textAreas = document.getElementsByTagName('textarea'); Array.prototype.forEach.call(textAreas, function(elem) { elem.placeholder = elem.placeholder.replace(/\\n/g, '\n'); });Placeholder text:
Hello, \nThis is multiline example \n\nHave FunLong Nguyen
ModeratorHi Henri,
The extension MB Views needs the REST API enabled on your site. When checking the site information in Tools > Site Health, I see some issues with your site REST API, screenshot https://share.getcloudapp.com/L1uNLmmw.
Please try to contact your hosting provider to ask for help to enable Rest API. Then you can re-check the View.
March 21, 2021 at 2:24 PM in reply to: ✅The supporting options of a custom post type doesn't work #26559Long Nguyen
ModeratorHi Henri,
If you are using the Block Editor and want to show the Custom Fields box after enabling support Custom fields, please open the Preferences > Panel > Turn on Custom fields. Screenshot https://share.getcloudapp.com/v1uNdXk4.
Long Nguyen
ModeratorHi Henri,
I also see you've created this topic https://support.metabox.io/topic/the-supporting-options-of-a-custom-post-type-doesnt-work/.
Please try to deactivate all plugins except Meta Box, MB extensions and switch to the default theme of WordPress (Twenty TwentyOne) then re-check this issue.
If it does not help, please share your site credentials via this form https://metabox.io/contact/, I will help you to check it.
March 20, 2021 at 10:11 AM in reply to: ✅The supporting options of a custom post type doesn't work #26547Long Nguyen
ModeratorHi Henri,
I've re-checked this issue on my local site but not reproduce it. Screen record https://share.getcloudapp.com/p9u8voy1.
Please try to update the newest version of MB Custom Post Type or MB AIO then re-check it. You can also hide a meta box in Screen Options.
Long Nguyen
ModeratorHi,
Thank you for your reporting.
I’ve informed the development team about this issue and it will be fixed in the next update as soon as possible.
Long Nguyen
ModeratorHi Jason,
Each image is a post (post type attachment). So you can delete images by using the function wp_delete_attachment() in the loop and check a condition if the post has meta (field) value https://developer.wordpress.org/reference/functions/get_post_meta/.
Long Nguyen
ModeratorHi Martin,
If you are editing the post in the backend, you can follow this topic to get post ID via jQuery with some lines of code https://stackoverflow.com/questions/19491336/how-to-get-url-parameter-using-jquery-or-plain-javascript.
Then you can get the post ID via the $_POST variable
$returned_title .= " - " . get_post_meta($_POST["post_id"], "job_status", true) . " - ";Long Nguyen
ModeratorHi,
There was a problem while getting the OSM sub-field in View. Please use it as a top-field, not inside a group to make it works, I will check this case and let you know later.
Fields:
$meta_boxes[] = [ 'title' => __( 'Lots à bâtir', 'your-text-domain' ), 'id' => 'lots-a-batir', 'post_types' => ['post'], 'geo' => true, 'fields' => [ [ 'name' => __( 'Prix', 'your-text-domain' ), 'id' => $prefix . 'text_prix', 'type' => 'text', 'label_description' => __( 'Prix sans symbole euro (€)', 'your-text-domain' ), ], ... [ 'name' => __( 'Osm', 'your-text-domain' ), 'id' => $prefix . 'osm_map', 'type' => 'osm', 'address_field' => 'address', 'language' => 'fr', 'region' => 'fr', ], ], ];Long Nguyen
ModeratorHi Martin,
You can use the extension MB Include Exclude to load the meta box for a/some specific page. Get more details here https://docs.metabox.io/extensions/meta-box-include-exclude/.
Or show a field base on some conditions with MB Conditional Logic https://docs.metabox.io/extensions/meta-box-conditional-logic/.
Long Nguyen
ModeratorHi,
If you are familiar with coding, you can follow our documentation to show the field value on the frontend https://docs.metabox.io/displaying-fields/.
Even using the MB Views, you still need some knowledge about coding HTML, CSS, Twig ... You can purchase the single plugin https://metabox.io/plugins/mb-views/ or upgrade the license to Developer Bundle or Lifetime Bundle https://metabox.io/pricing/.
Basic knowledge about custom post type template here https://developer.wordpress.org/themes/template-files-section/custom-post-type-template-files/.
Long Nguyen
ModeratorHi,
Did you try to use the plugin Code Snippets?
https://wordpress.org/plugins/code-snippets/I've explained the reason to use this plugin above.
March 17, 2021 at 10:45 PM in reply to: ✅Problem displaying videos in group - video values don't seem to be returned #26494Long Nguyen
ModeratorHi,
There was a problem while getting the video sub-field in View. Please use it as a top-field, not inside a group to make it works, I will check this case and let you know later.
Fields:
... [ 'id' => $prefix . 'group_updates_photos', 'type' => 'group', 'fields' => [ [ 'id' => $prefix . 'job_update_photo', 'type' => 'image_upload', 'name' => esc_html__( 'Photo Upload', 'text-domain' ), 'max_status' => false, 'max_file_uploads' => 1, 'desc' => esc_html__( 'Please limit to one photo per day', 'text-domain' ), 'clone' => 1, 'add_button' => esc_html__( 'ADD ANOTHER PHOTO', 'text-domain' ), ], ], 'default_state' => 'collapsed', 'collapsible' => true, 'group_title' => 'Photos', ], [ 'id' => $prefix . 'job_update_video', 'type' => 'video', 'name' => esc_html__( 'Video Upload', 'text-domain' ), 'desc' => esc_html__( 'Please limit to one video of up to 1 minute per day', 'text-domain' ), 'max_file_uploads' => 1, 'clone' => 1, 'add_button' => esc_html__( 'ADD ANOTHER VIDEO', 'text-domain' ), 'max_status' => 1, ], ...View:
{% for clone in post.job_update_video %} {% for item in clone %} <tr> <td colspan="5">VIDEO: <video width="320" height="240" controls><source src="{{ item.src }}" type="video/mp4"></video></td> </tr> {% endfor %} {% endfor %} -
AuthorPosts