Skip to content

Commit

Permalink
PLANET-6911: Update blocks frontend output to accessible HTML
Browse files Browse the repository at this point in the history
Replace save function with frontend component
Remove render_callback
  • Loading branch information
lithrel committed Jan 3, 2023
1 parent 004ecb8 commit 593d499
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
5 changes: 4 additions & 1 deletion assets/src/blocks/Splittwocolumns/register.js
@@ -1,4 +1,5 @@
import { SplittwocolumnsEditor } from './SplittwocolumnsEditor';
import { SplittwocolumnsFrontend } from './SplittwocolumnsFrontend';
import { frontendRendered } from '../frontendRendered';
import { splitTwoColumnsV1 } from './deprecated/SplittwocolumnsV1';

Expand Down Expand Up @@ -47,7 +48,9 @@ export const registerSplittwocolumnsBlock = () => {
} },
},
edit: SplittwocolumnsEditor,
save: frontendRendered( BLOCK_NAME ),
save: ({ attributes }) => {
return <SplittwocolumnsFrontend {...attributes} />
},
supports: {
html: false, // Disable "Edit as HTMl" block option.
},
Expand Down
3 changes: 0 additions & 3 deletions classes/blocks/class-splittwocolumns.php
Expand Up @@ -79,9 +79,6 @@ public function __construct() {
[
'editor_script' => 'planet4-blocks',
'attributes' => self::ATTRIBUTES,
'render_callback' => function ( $attributes ) {
return self::render_frontend( self::update_data( $attributes ) );
},
]
);
}
Expand Down

0 comments on commit 593d499

Please sign in to comment.