slug ) { $page_slug = 'page'; } if ( 'single' === $template_type->slug ) { $post_slug = 'single'; } } $what_post_type = get_post_type( $post_ID ); switch ( $what_post_type ) { case 'page': $template_slug = $page_slug; break; default: $template_slug = $post_slug; break; } } $current_template = get_block_templates( array( 'slug__in' => array( $template_slug ) ) ); if ( ! empty( $current_template ) ) { $template_blocks = parse_blocks( $current_template[0]->content ); $post_content_block = gutenberg_find_first_block( 'core/post-content', $template_blocks ); if ( ! empty( $post_content_block['attrs'] ) ) { $settings['postContentAttributes'] = $post_content_block['attrs']; } } return $settings; } add_filter( 'block_editor_settings_all', 'gutenberg_get_block_editor_settings_experimental', PHP_INT_MAX );