Retrieve data from the endpoint in JS (in my case, this is inside a Vue.js method):
fetch('/wp-json/canopy/v2/acf--colspec/')
.then(resp => {
// Yay, data!
return resp.json();
})
.then(data => {
// Do stuff
})
.catch(function() {
// Handle errors
});
Thanks to your suggestion I wound up learning how to create a custom endpoint, so thanks for that!
I wound up creating a custom endpoint that executes and returns the result of a get_field();
call against my options field, which worked a charm.
Here’s what I wound up with, in case it’s helpful for anyone else trying to do something similar:
Set up the endpoint and callback:
function cp_colspec_endpoint() {
$field = get_field('col_spec','options');
return $field;
}
//expose acf options page field(s) through custom endpoint
function cp_register_api_endpoints() {
register_rest_route( 'canopy/v2', '/acf--colspec', array(
'methods' => 'GET',
'callback' => 'cp_colspec_endpoint',
) );
}
add_action( 'rest_api_init', 'cp_register_api_endpoints' );
Hm — I posted a reply with a a bunch of details, but it seems to have disappeared while editing it for some reason. Bummer 🙁
Re-posted my original notes below…
Anchor IS indirectly mentioned in the documentation: the documentation states:
supports
(Array) (Optional) An array of features to support. All properties from the JavaScript block supports documentation may be used. The following options are supported:
If you read the linked documentation at https://developer.wordpress.org/block-editor/developers/block-api/block-supports/ — anchor is the first parameter on the list.
Bump — just curious if there’s been any progress on this deficiency?
Thanks!
I’m having the same issue — I accidentally clicked an arrow, and now I can’t retrieve my field set from the sidebar — and attempting to change the position from the fieldset’s own edit screen has NO effect. I’m not sure what the intended functionality is supposed to be here, but it’s not working.
Any advice about how to get my fieldset back to where it’s intended to be, other than trashing it and remaking it, or disabling Gutenberg, would be very appreciated.
Thanks!
I’ve now tested 5.8-beta3, and it does fix the issue for me as well. Whew!
Thanks ACF team for tackling that!
Are those betas available anywhere for download/installation? I’ve got clients giving me some serious stink-eye about the mess in admin right as they’re smack in the middle of populating content for the launch of their new website, and I’d sure like to resolve this for them ASAP if possible.
Cheers
Edit: figured out that they’re available through the account screen (I’d previously looked at the github repo to no avail).
thanks — I’ll give that a shot and report back!
Holy. Heck.
This is great—I’ve been bashing my head against the wall trying to figure out what was going on with this whole postmeta black-hole issue. I have encountered it with both ACF and another custom plugin which leverages postmeta to store supplementary content.
I’m off to test this immediately.
Is the WP community at large aware that this behaviour is occurring? I’ve done a bunch of poking around, but can’t find any formal documentation of this bug anywhere, but I can concur that it definitely exists.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.