| @@ -42,8 +42,21 @@ | ||
| 42 | 42 | protected function supports_alignment() { |
| 43 | 43 | return true; |
| 44 | 44 | } |
| 45 | 45 | |
| 46 | + /** | |
| 47 | + * Keep saved markup pointing at the style class build_css() emits — see | |
| 48 | + * AtomicStyles::refresh_style_class(). | |
| 49 | + */ | |
| 50 | + public function render_callback( $attributes, $content, $block_instance ) { | |
| 51 | + $content = AtomicStyles::refresh_style_class( | |
| 52 | + $content, | |
| 53 | + isset( $attributes['styles'] ) && is_array( $attributes['styles'] ) ? $attributes['styles'] : [], | |
| 54 | + $this->supports_alignment() && isset( $attributes['alignment'] ) && is_array( $attributes['alignment'] ) ? $attributes['alignment'] : [] | |
| 55 | + ); | |
| 56 | + return parent::render_callback( $attributes, $content, $block_instance ); | |
| 57 | + } | |
| 58 | + | |
| 46 | 59 | /** Block-specific declarations, appended after the shared style rules. */ |
| 47 | 60 | protected function extra_css( $base, $attributes ) { |
| 48 | 61 | return ''; |
| 49 | 62 | } |