I’m not sure that I understood exactly your goal, but check if hooking to render_block does what you want, as it will modify the block’s output before it gets rendered in the frontend. Usage example:
add_filter( 'render_block', 'my_dynamic_data', 10, 2 );
function my_dynamic_data( $block_content, $block ) {
if('my_value' === $block['attrs']['myAttribute'] ) {
// Do something
}
return $block_content;
}
Related Posts:
- How to find list of all functions bind to a particular hook from my plugin?
- Can I Hook Into the TinyMCE Insert/Edit Link Button to Use Shortlink For Post?
- Include HTML (Bootstrap Modal Box) with a plugin into my header
- wordpress automatic update does not run
- Using init hook for register_taxonomy is causing invalid_taxonomy in wp_insert_term()
- How Can I Add Code To A Preexisting Function Without Editing it
- Adding tables to dashboard pages programmatically?
- Setting post_id for single.php based on URL without a redirect
- Modify custom block plugin without losing content
- Console errors in 6.0-RC1 Widget screen
- Custom Block Not Shown in Block Inserter
- How to override supports of innerBlocks?
- How to use attributes in competent of Gutenberg
- var(–text-color) in style.scss works once but not twitch
- How to do admin ajax request in a plugin for rest api
- When setting styles to an extended block that was saved as a pattern, it doesn’t remove the style that was there
- Action / Hook when a new plugin is added
- wordpress full site editing problem when extending core blocks
- apply_filters() and call_user_func() to define and call a function outside a class
- Pass custom props to
- Getting incorrect filepath inside custom block front-end output using @wordpress/create-block tutorial
- extraprops override existing props
- Trigger function on Remove block or add new block in Gutenberg JavaScript
- WPGut – Updating failed and shortcode?
- Rerender core Templates with with ToggleControl but it doesnt recognize block type
- Gutenberg – Call google map render function in save after DOM has been rendered
- Gutenberg block breaks when showing new data
- HTMLCollection not counting right in editor? / for loop not working on elements in DOM
- What happens/fires when you select a block in the editor?
- Is “document loaded” different on admin side than public side?
- How to re-render inspector controls?
- How to use setAttributes outside of the edit function return
- why is apiFetch throwing Unhandled Promise Rejection: TypeError: Object is not a function
- Reading plugin settings in esnext wordpress block
- Get value of custom checkbox from Gutenberg sidebar in plugin
- Where to save Gutenberg plugin data?
- ajax-action.php can’t find added action
- Post is uncatagorized in publish_post action
- Gutenberg component in a plugin admin
- How to integrate plugins into block editor
- WordPress Plugin Boilerplate – add actions and/or filters based on user’s role
- Add custom html classes to gutenberg wrapper
- How to get access the ID of all posts of custom post type in Gutenberg editor
- do_action from within a class does not seem to work
- How to create save function for custom Gutenberg style block?
- wp_ajax add_action fuction won’t fire on custom jQuery action
- remove different admin menu for specific users
- WordPress Reset password Strength set to medium
- add_option_{$option} action hook not being called
- Does WordPress have something like timer hook?
- action callback, for action dispatched as reported by hook sniffer, not called
- How can I set a dynamic value for post_updated_messages based on return value of post_updated?
- Sending Parameter Failed
- How to remove a class [closed]
- Insert plugin html content to a specific spot in the frontpage
- Apply function on all action hooks?
- Gutenberg and custom blocks messed up pagespeed score. What did I wrong?
- Gutenberg text field validation
- Custom plugin not appearing
- Gutenberg’s Popover component position relative to the focused element
- Undo operation not working in Rich text [Gutenberg]
- How can i add insertion point between inner blocks in my custom block like core blocks
- Gutenberg: – Call a function after Server Side Component is rendered
- Accept only PDF file for upload
- Render raw html in Gutenberg block
- get the queried_object of an url
- Build a dynamic block using the default attributes
- Help interpreting @wordpress/create-block-tutorial-template usage error
- Add custom data-attribute to core Gutenberg block within an template
- Call API on post save/update and show the result in admin area
- How can I add a custom button to the post editor?
- How to get custom user meta by id in custom Gutenberg block
- How to replace content of a block in and re-render on change?
- extending a core block doesn’t work inside the editor
- Block Development: hamburger module throwing error in save function
- Adding a navigation with wp_nav_menu() to a custom block in the site editor
- Why isn’t custom sidebar panel not showing up in the Gutenberg Editor?
- Ninja Forms: Front-End Forms, Post ID?
- REST API error in block editor for custom templates
- Reinitiate Gutenburg’s blocks using javascript
- How can I include React useState in a custom gutenberg block plugin?
- Remove Gutenberg Buttons Block
- Set srcset on a block image
- Insert text programmatically in WordPress Gutenberg Editor
- Translations not making it into Block UI but work in the rest of the plugin
- Javascript function defined in view.js not reachable from save.js
- How to move custom gutenberg block controls from settings to styles tab?
- How can I obtain an option (get_option) inside a block viewScript?
- WordPress 6.6.1 – Trying to make a block but receive error, “! Cannot read property ‘then’ of undefined”
- How to use useSelect to retrieve the currently default fontFamily?
- Event when Modal is opened/visible
- Template locked block does not show appender
- move useState variable from edit.js to save.js. How do I do that?
- Multiple php files in dynamic gutenberg block
- Access DOM Element in Gutenberg Block on WP Admin Post Edit Screen
- My WordPress plugin don’t show the button on Gutenberg
- Gutenberg InnerBlocks noallowedblocks on parent but allowedblock on Child
- Warning: Cannot update a component (`Unknown`) while rendering a different component
- Custom Gutenberg Block ‘Stylized List’ – Incorrect Rendering and Looping of List Items
- Rebuild Core Block as Separate Plugin