Multisite: Display a reusable block with a shortcode?
-
I have a multisite network and I can use this to display a dashboard widget made up from a Gutenburg reusable block:
add_action('wp_dashboard_setup', 'my_custom_dashboard_widgets'); function my_custom_dashboard_widgets() { global $wp_meta_boxes; wp_add_dashboard_widget('custom_help_widget', 'Our Support', 'custom_dashboard_help'); } function custom_dashboard_help() { // get reusable gutenberg block: $gblock = get_post( 135 ); $block = apply_filters( 'the_content', $gblock->post_content ); echo '$block;
It displays the contents of the block ID=135 in the dashboard – but only in the site there I create the block.
Is it possible to do something like this that would let me create a block in the main site and have it visible in the dashboard of all of the other sub-sites?
- The topic ‘Multisite: Display a reusable block with a shortcode?’ is closed to new replies.