Forum Replies Created
-
AuthorPosts
-
brandonjp
ParticipantSorry, I hit the back button and I thought I was editing my post. π€¦ββοΈ π
brandonjp
ParticipantI think I was having an issue with priority and shortcodes. This seems to be working now, but if there is a better or more preferred way, I'm interested to know. Thank you!
add_filter( 'rwmb_meta', function( $value, $field_id, $args, $object_id ) { // look for my custom fields $filterThese = array('extra_info','user_notes','manager_notes'); if ( in_array($field_id, $filterThese, true) ) { // run my custom field values through the filter return filter_keywords($value); } return $value; }, 99, 4 );January 3, 2023 at 3:43 PM in reply to: β Bug: select2 Taxonomy Advanced values not displaying when 'Multiple' selected #40102brandonjp
ParticipantMy apologies, I just discovered that the issue has been fixed in the git repo.
https://github.com/wpmetabox/meta-box/commit/d18fe9a84d29fab1b66a5454b19b05c8c7cc380d
Thank youbrandonjp
ParticipantI'm using MB Term Meta * Version: 1.2.10
Thanks for looking into it. But no problem, Iβll just stick with
get_term_metabrandonjp
ParticipantHi Peter. Thanks for the reply. Truthfully this is not a big issue for me now, as I have it working using
get_term_meta()but I am still curious whyrwmb_meta()does not work.Below is the code used to create user select meta field on the taxonomy: https://cln.sh/QO9iJ6
array( 'id' => $prefix . 'pm_related_user', 'type' => 'user', 'name' => esc_html__('User Account', 'text-domain'), 'desc' => esc_html__('Select the User Account for this PM.', 'text-domain'), 'class' => 'add-add-new', 'query_args' => array( 'role__in' => 'c_____project_manager', ), 'field_type' => 'select_advanced', 'tab' => 'pm-tab', ),Here are some samples of the database where the user ID is correctly saving to the meta field
pm_related_user- https://cln.sh/4uPNJ3Thanks, Peter!
--Brandonbrandonjp
Participanthmmm...
var_dump($value)from the above code is showingbool(false)brandonjp
ParticipantI have this same exact same issue VERY often... even when there is no static page with the same slug. I don't understand what causes it, but here's how I usually fix it...
- change the slug of the CPT to something random/unique
- go to:
/wp-admin/options-permalink.php& change the permalink structure - go back to your CPT and change the slug back to what you want
- go back to:
/wp-admin/options-permalink.php& change the permalink structure to what you want
Usually that fixes it for me.
brandonjp
ParticipantIf it helps anyone else... I often *think* have this problem until I realize that I forgot to change the View Type - https://docs.metabox.io/extensions/mb-views/#type
Often, I'll be trying to insert a Shortcode view into a page and the CSS will not render and then I'll realize I never selected "Shortcode" ... and that makes all the difference π
February 16, 2022 at 2:42 AM in reply to: View is using same post for every item on Posts/Archive page #33923brandonjp
ParticipantHi Long, Thanks for the quick reply. I created a work around, but the issue still exists. (I had to present the site yesterday, but I have switched it back to the broken version today.)
The issue happens when I use the default WP latest posts page. In WP Admin Settings > Reading, if I set "Your homepage displays" to "Your latest posts" then the view does not use the correct post. I have put this shortcode in the posts list using the new WP theme editor like this: https://cln.sh/dNr79H but it continually only renders the First (most recent) post - like this:L https://cln.sh/gFbeKj - rather than the current post in the loop.
Here again is the site - currently back to the broken version on the homepage: https://omnimodern.little.am/
February 14, 2022 at 6:05 AM in reply to: β Getting 404 error when trying to view post created with custom post type #33883brandonjp
ParticipantThis info should be part of the official documentation (or even better, as a note on the admin screens when listing or adding a new View). Almost every time I use MB Views, I spend a few minutes trying to figure out why the views are returning 404... every time I go through this process of thinking... "It's broken... but it can't be... MetaBox is perfect... It's my site... I need to wipe everything and do a clean WP install..." until I eventually start googling and find it in my search history and then end up on a forum post. And every time re-saving the permalink structure fixes it. π maybe one day I'll remember that right away!
brandonjp
ParticipantJust an update that my solution to set a square bracket array... I thought it was working, but realized it's not now and maybe never was!
So best to stick with Anh Tran's answer #16001 (he's always the best person to trust anyhow π)
geo.types.0=(cities)
geo.types.1=establishmentAugust 3, 2020 at 11:34 PM in reply to: β Taxonomy select_advanced select2 field is very slow #21099brandonjp
ParticipantI have an update!
#1 - I've run over 50 tests and replicated my site onto 5 different server environments & found that the issue is with my server, DreamPress by DreamHost. Even on regular shared hosting from DreamHost (their non-DreamPress hosting), the site performs on average 5x better. I typically love DreamHost, but for this particular site we are switching to a different host. DreamPress explained to us that:
"Reviewing the site further, it does perform better on our non-DreamPress services such as shared or VPS. What that tells me is that the way that your plugin is configured is it's either not compatible with a proxy-based setup like we use on DreamPress as we use ngxcache to serve the site, which reverse proxies back to apache or the way it's handling caching is causing the problem and needs to have a rewrite."
I don't really understand exactly how that's affecting our plugin, as our plugin is not very complicated (other than it uses MetaBox for lots of custom fields with MB Custom Table).
Are you familiar with ngxcache & reverse proxies? Or have you had any other users where MetaBox.io plugin has performance issues because of caching?
#2 - However, there is the secondary issue that
select_advancedselect2 fields are still waiting on an ajax query on first click, even though they are simply fetching the same terms that were already loaded into the page. I think this should probably be a separate bug report, as I don't think this is how Metabox's select2 is expected to behave.brandonjp
ParticipantHello- I have realized something... Even though the first 10 are loaded, I think it is still making a new AJAX request and waiting on request to finish before it shows the first 10 that were pre-loaded. https://cln.sh/xgwV9g
Also in your screen recording it seems to take 2.5 seconds, which is a long time to load 10 items that are already in the page.
July 28, 2020 at 11:38 PM in reply to: β Taxonomy select_advanced select2 field is very slow #21002brandonjp
ParticipantThanks, Long. On the docs, it says
When the field is loaded, Meta Box only queries for saved terms (which is usually not many). So the initial query is very minimal and doesnβt cause any performance problem.
screenshot: https://cln.sh/mxnF3I
What does saved terms mean?
Right now we've got 150 tags and it takes usually 15 seconds to populate the dropdown, and it's currently set to only query for 10 terms.
- Is reducing the number of terms in the DB the only option?
- Would our internet speed or anything else be contributing you could think of?
- We're using MB Custom DB Tables, would that make it slower?
My next idea is I'm thinking about loading all terms as JSON into the browser on the page load. My users would be happier with extra time on page load, I think.
brandonjp
ParticipantIt works! Thanks, Anh!
-
AuthorPosts