How to get ACF value inside Gutenberg Block from another page or template? I’m using Timber too

You’ll need to set a render callback when you create your ACF block: acf_register_block_type( array( ‘name’ => ‘example-block’, ‘title’ => __( ‘Example Block’, ‘your-text-domain’ ), ‘description’ => __( ‘A custom example block.’, ‘your-text-domain’ ), ‘render_callback’ => ‘my_acf_block_render_callback’, ‘category’ => ‘formatting’, ‘icon’ => ‘admin-comments’, ‘keywords’ => array( ‘example’ ), ) ); Then in that function you … Read more

Icons are missing from Visual Editor

After a few more days of frustrating testing, I managed to track the issue down to the External Links Rewrite option in Siteground’s Site Tools, under SSL options. When HTTP Enforce is enabled with the optional External Links Rewrite option (being able to see these changes virtually immediately in the browser requires a Force Refresh, … Read more

How to get all the available post tags using the WP Data Module?

Checking in Github and Stackoverflow, I found this way: wp.data.select( ‘core’ ).getEntityRecords( ‘taxonomy’, ‘<taxonomy_slug>’, { per_page: -1, page: 1 } ) In my case the taxonomy slug is post_tag. So I was able to retrieve all the tags from my website using: select( ‘core’ ).getEntityRecords( ‘taxonomy’, ‘post_tag’, { per_page: -1, page: 1 } )

how can default_content filter tell if content will load in block editor or classic editor?

Looks like WP_Screen::is_block_editor() is what you want. Here’s some rough code to demonstrate: add_filter( ‘default_content’, function( $content, $post ) { $screen = function_exists( ‘get_current_screen’ ) ? get_current_screen() : null; $is_block_editor = $screen ? $screen->is_block_editor() : false; if ( $is_block_editor ) { // Do your block editor stuff here } else { // Do your classic … Read more

Override RenderCallback from LatestPosts

You certainly can do (not recommended). I just dig into the source there’s no filter/action hooks used in register_block_type() and it’s related classes. The only way (WordPress 5.3) is to redefine the latest post block again within your theme or plugin. The best way will be creating your custom blocks. // Remove the existing action … Read more