Comments (5)
Closing this now. I tried and succeeded.
from acf-oik-blocks.
With ACF PRO v6.1.6 the HTML for the acf/block-count
block is simpler
<!-- wp:acf/block-count {"name":"acf/block-count","data":{},"mode":"preview"} /-->
data
is now an empty arrayalign
defaults to null so the attribute isn't set
When the value is changed in the seamless metabox, the block count doesn't update automatically.
You need to choose Update then view the post.
Different versions of Preview don't pick up the change, since it's not yet been applied in the server.
from acf-oik-blocks.
When I changed the Field Groups Settings so that the block count could be edited within the block
then the value entered ( 33 ) didn't override the value stored in meta data ( 42 ).
<!-- wp:acf/block-count {"name":"acf/block-count","data":{"field_5dc8302fb9fa3":"33"},"mode":"edit"} /-->
I'll need to read the docs. The original code just accesses the post meta data using get_field()
function acf_oik_blocks_callback( $block, $content, $is_preview, $post_id ) {
bw_trace2();
echo "Block count: ";
$block_count = get_field( '_block_count', $post_id );
echo $block_count;
}
from acf-oik-blocks.
Since ACF PRO 6.0 block.json became the recommended way of registering blocks - matching the native WordPress registration methods.
See https://www.advancedcustomfields.com/resources/blocks/
We should update the code to register this block using this method.
See also https://www.advancedcustomfields.com/resources/acf-blocks-with-block-json/
from acf-oik-blocks.
Additional blocks to register are:
block name | rendering method | function / file |
---|---|---|
acf/block-count-2 | renderCallback | acf_oik_blocks_callback |
acf-oik-blocks/block-count-3 | renderTemplate | block-count-3.php |
from acf-oik-blocks.
Related Issues (2)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from acf-oik-blocks.