Justin Sternberg
Forum Replies Created
-
Hmm I was wrong, doesn’t look like there’s a way to enable markdown for a post-type without it also becoming the default for editing all existing/new posts.There is a setting in the Preferences panel.- This reply was modified 7 months, 1 week ago by Justin Sternberg.
Hacky solution to fix the JS error:
add_action( 'wp_print_footer_scripts', function() { ob_start(); }, 0 ); add_action( 'wp_print_footer_scripts', function() { $content = ob_get_clean(); $content = str_replace( 'var codeClass = pre[i].children[0].className;', 'var codeClass = pre[i].className === "mermaid" ? "language-mermaid" : pre[i].children[0].className;', $content ); echo $content; }, 9999 );
Forum: Reviews
In reply to: [CMB2] So Happy to See Updateshey Mika, it’s always nice to hear from you. Thanks for the kind words! PHP 8 compat sounds good…
Forum: Plugins
In reply to: [CMB2] REST API Update fieldWhen testing this in my API app, Insomnia, I was seeing this same behavior (the POST request not updating the field). It turned out it was because I was using the wrong url (in my case
http
instead ofhttps
and the server was doing a redirect and changing to aGET
).
See screenshot here: https://a.supportally.com/i/hBDQ9a
Check to see if you’re experiencing the same.You could also add some logging to your server to see what the request method is when it lands there. E.g.
error_log( '$_SERVER[REQUEST_METHOD]: ' . print_r( $_SERVER['REQUEST_METHOD'], true ) );
Forum: Plugins
In reply to: [CMB2] REST API Update fieldSorry, one last look at your payload and it looks correct except that you’re passing in the body instead of query args. Try following the recommendation in the docs with the query args.
Forum: Plugins
In reply to: [CMB2] REST API Update fieldSee the REST API docs. It covers these routes and what the object_type is. If you still run into issues, let us know.
https://github.com/CMB2/CMB2/wiki/REST-API#routesI marked it resolved. Will definitely need to get a release out soon.
That’s my fault, I forgot to actually push my local changes up. Please re-download the develop branch and try again!
Have you pulled the most recent version of the
develop
branch? Also, how are you including the hpos lib? Provide your cmb2 code please.Ok, I spent a bit too much time on this, but I created an addon for this specifically: https://github.com/CMB2/cmb2-woocommerce-hpos-orders
You’ll need the latest in thedevelop
branch of CMB2: https://github.com/CMB2/CMB2Once the addon is installed, using
woocommerce_page_wc-orders
as an object_type in your metabox registration should “just work”. ??To investigate, we’ll need your entire CMB2 code to try and reproduce it (and whatever testing steps to enable/test with HPOS).
Forum: Plugins
In reply to: [CMB2] BUG Editing repeateble field delete text valueThere are some known bugs with the repeater and changing order. You could try testing some related PRs to see if it helps: https://github.com/CMB2/CMB2/pull/1324, https://github.com/CMB2/CMB2/pull/1145 to see if they address the issue
Forum: Plugins
In reply to: [CMB2] PHP Errors and JavaScript IssuesGlad it’s sorted. ??
Forum: Plugins
In reply to: [CMB2] PHP Errors and JavaScript IssuesYah the issue is the default_cb param is set to
date
so it’s calling that as a function. If trying to set a string, then probably need to do something like this:’default_cb' => function() {return ‘date’;}
Forum: Plugins
In reply to: [CMB2] PHP Errors and JavaScript IssuesThe theme code that uses CMB2.