Skip to content

Commit

Permalink
Remove some comments
Browse files Browse the repository at this point in the history
  • Loading branch information
SantosGuillamot committed Dec 22, 2023
1 parent 201db32 commit 9d2c667
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 14 deletions.
10 changes: 0 additions & 10 deletions lib/experimental/blocks.php
Original file line number Diff line number Diff line change
Expand Up @@ -167,16 +167,6 @@ function process_block_bindings( $block_content, $block, $block_instance ) {

// Add filter only to the blocks in the list.
foreach ( $block_bindings_allowed_blocks as $block_name => $attributes ) {
// if ( ! function_exists( 'process_block_bindings' ) ) {
// function filter_metadata_registration( $metadata ) {
// var_dump( $metadata );
// die;
// $metadata['usesContext'] = array( 'postId', 'postType', 'queryId' );
// return $metadata;
// }
// add_filter( 'block_type_metadata', 'filter_metadata_registration' );
// }

add_filter( 'render_block_' . $block_name, 'process_block_bindings', 20, 3 );
}
}
Expand Down
4 changes: 1 addition & 3 deletions packages/editor/src/components/block-bindings/fields-list.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,7 @@ export default function BlockBindingsFieldsList( props ) {

// TODO: Try to abstract this function to be reused across all the sources.
function selectItem( item ) {
// Modify the attribute we are binding.
// TODO: Not sure if we should do this. We might need to process the bindings attribute somehow in the editor to modify the content with context.
// TODO: Get the type from the block attribute definition and modify/validate the value returned by the source if needed.
// Modify the attribute binded.
const newAttributes = {};
newAttributes[ currentAttribute ] = item.value;
setAttributes( newAttributes );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ if ( window.__experimentalBlockBindings ) {
[ context.postId, context.postType ]
);

// TODO: Explore how to get the list of available fields depending on the template.
if ( ! data || ! data.meta ) {
return <BlockEdit key="edit" { ...props } />;
}
Expand Down

0 comments on commit 9d2c667

Please sign in to comment.