Forum Replies Created
-
AuthorPosts
-
brandonjp
ParticipantThis is a great update! Thanks, Will & Ahn!
brandonjp
ParticipantHi Anh- I'm having this issue today whilst updating from AIO 1.10.8 to 1.10.12
Error states:
Plugin update failed.
An error occurred while updating Meta Box AIO: The package could not be installed. The package contains no files.

brandonjp
ParticipantThis topic can be marked
✅ResolvedI tracked down that I can watch the address input field for
selected_addressevent:jQuery('input#address_job_site').on('selected_address', function(event) { // do stuff });brandonjp
Participant@Anh
I can understand both sides of this. But for me, this is not a major issue either way. So do what you think is best for MB, of course!@Ryan
Regardless of what's done, I wonder if using a pattern attribute would help? Maybe something like(0[1-9]|1[012])[- /.](0[1-9]|[12][0-9]|3[01])[- /.](19|20)\d\d(I stole that one from: http://html5pattern.com/Dates ) to ensure the field doesn't pass validation unless the format ismm/dd/yyyy. https://imgur.elightup.com/tdHJXfT.png Then your users could still manually input a date (IF that's desired). Also, I tested setting the display values &save_formatand they all seem to be working correctly for me based on the docs -- If those aren't working for you, that could be a separate issue to look into. Here are the values I was using in Builder to quickly test: https://imgur.elightup.com/ZJFvMX4.pngI first came across this and posted it because we were having cases when the field was
readonlybut users were tabbing past the field and the datepicker was showing and they were submitting data. Basically, it just seemed incorrect that a 'readonly' field wasn't read-only. For us, the problem was that the field has different attributes based on conditions (beyond just MB conditions/logic). And while enabling/disabling the datepicker is an option, it wasn’t our approach because it seemed more accurate that areadonlyfield should not be allowed to change. (Of course, as Anh mentioned earlier, jQuery UI chooses to ignore readonly.)Our workaround was to use a disabled input, but that prevents the field from submitting (which was an issue because we still wanted the input to submit every time).
brandonjp
ParticipantI ended up accomplishing this using a Custom HTML field & a little PHP and JS.
If anyone else ends up needing direction on this, here are a few links. This is not a drop-in solution for you but hopefully helps get you started.
PHP to handle an incoming AJAX request for term metadata & return JSON:
https://gist.github.com/21fed6266453de7ba76b3d2bc0e5a06fJS to fetch the taxonomy term metadata and place it into the page:
https://gist.github.com/3b636d0c7e55ce6dc58ceba3de9a974eAdd Custom HTML field with html to support the incoming term metadata (I also give it a custom class):

After selecting a taxonomy it populates the Custom HTML like so:
October 9, 2019 at 4:38 AM in reply to: ✅How to link an Admin Column value to the post edit screen #16443brandonjp
ParticipantFor those following along at home...
I'm not sure of the actual Meta Box way to do this, but I've ended up using Admin Columns Pro - https://www.admincolumns.com -- It plays very nicely with Meta Box (even though there's no "official" integration). It supports displaying custom fields, relational data, inline editing of custom fields. I LOVE IT! Well worth the price.
brandonjp
ParticipantOn my sites, I'm currently using this ? chain which disables autocomplete on the address fields (in Chrome) and prevents the return key:
jQuery('form#post input[id^=address][type=text]').attr('autocomplete', 'new-password').keypress(function(e) { if (e.which == 13) return false; });A few other options for this...
1️⃣
This ? disables submission anytime the Enter/Return key is pressed inside any form element (including Google Maps, but also on any other element):jQuery('.wp-admin.post-type-CUSTOMPOST form#post').keypress(function(e) { if (e.which == 13) return false; });Here ? I'm targeting only the pages for my custom post type called
CUSTOMPOST(so change that to your post type) or else just usejQuery('form#post')....to attach this to all edit post screens.2️⃣
And for completeness... there is also Google Maps' prescribed way of adding event listeners: https://developers.google.com/maps/documentation/javascript/events#DomEvents ?google.maps.event.addDomListener(jQuery('#idOfTextInput')[0], 'keydown', function(e) { if (e.keyCode === 13) return false; });Since we're in WordPress, I'm still using jQuery here ? you could easily write it with plain JS if needed. But since I'm still using jQuery here, I don't see the reason for using the Google Maps method.
October 9, 2019 at 2:47 AM in reply to: The "Meta Box" way to disable Autocomplete & Autofill? #16440brandonjp
ParticipantIs there a way inside MB Builder to add an attribute (like
autocomplete="off") to the entire form ?brandonjp
Participant@pza I use JSON syntax and it seems to work fine.
On your custom attribute (in your original post) you're creating an object inside an array:
I tried adding a custom attribute of geo.types =>
[{"establishment","(cities)"}]But it just needs to be an array with two values:
['establishment','(cities)'](no inner curly brackets)
September 28, 2019 at 12:47 AM in reply to: Is it possible to inline add a new record on a related post type? #16331brandonjp
ParticipantThanks, Anh.
Also, I just added a few config notes to the README to answer a few questions that someone else asked: https://github.com/brandonjp/add-add-new-to-meta-box-select-advanced#for-developers
A couple quick notes: After adding a new post in the modal, the user must search again in the Select Advanced to trigger a new query and find their newly created post. And Ideally, I'd open the modal without WP Admin toolbar by setting
IFRAME_REQUEST(as shown here: http://rizqy.me/create-modal-box-on-wordpress-dashboard/ ), but I'm not quick enough to whip that up yet.Again... It's very quick & messy code 🙂 But feel free to ask if anything doesn't make sense.
September 26, 2019 at 7:58 AM in reply to: Is it possible to inline add a new record on a related post type? #16295brandonjp
ParticipantI'm still working on this. Currently, it's the only thing that prevents me from using Meta Box for every project.
I made a REALLY messy plugin here that satisfies what I need for a current project:
https://github.com/brandonjp/add-add-new-to-meta-box-select-advancedIf you have a Select Advanced field used for selecting a related post, this will add an "Add New" button that opens a modal. There are a few options inside the JS file.
Hopefully, it might help others toward their own solutions. If you have questions, let me know.

brandonjp
ParticipantI'm looking into this as well. Toying with a few options this week.
Currently investigating this: https://wordpress.org/plugins/wp-pdf-templates/
But if anyone else has input or experience, do tell! 🙂
brandonjp
ParticipantPerfect. Thank you.
September 21, 2019 at 4:06 AM in reply to: ✅How to display custom field name & label_description in template? #16218brandonjp
ParticipantI figured this out by using:
<?php echo rwmb_get_field_settings( 'end_date' )['name']; ?>
to display the field's Label (from the General tab)<?php echo rwmb_get_field_settings( 'end_date' )['desc']; ?>
to display the field's Description (from the General tab)<?php echo rwmb_get_field_settings( 'end_date' )['label_description']; ?>
to display the Label Description (under the Appearance tab)<?php echo rwmb_meta( 'end_date' ); ?>
to display the field's value stored in the DBbrandonjp
ParticipantI get now that the Core must be installed as well.
I installed it inside my site from WordPress.org & everything seems fine now. Also, I found this old post: https://support.metabox.io/topic/installed-aoi-cant-see-anything/
Could be good to update docs & blog post to indicate this, just to save others a little time. Even as a daily MB user, it seemed a little confusing at first
Thanks. Case closed!
-
AuthorPosts