Skip to content

Commit ffdfa8f

Browse files
authored
Merge pull request #45 from BeAPI/fix/acf-json-block-impl
implement `get_block_args` method in `Acf_Json_Block`
2 parents 23e2262 + 1cff3b9 commit ffdfa8f

3 files changed

Lines changed: 20 additions & 2 deletions

File tree

classes/Blocks/Acf_Block.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,12 @@ public function render( array $block, $content = '', $is_preview = false, $post_
7777

7878
$tpl = Helpers::load_template( 'template-admin-block-invalid' );
7979
if ( ! empty( $tpl ) ) {
80-
$tpl( [ 'block' => $block, 'error_messages' => $errors ] );
80+
$tpl(
81+
[
82+
'block' => $block,
83+
'error_messages' => $errors,
84+
]
85+
);
8186
}
8287

8388
return;

classes/Blocks/Acf_Json_Block.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,13 @@ public function register(): void {
2626
]
2727
);
2828
}
29+
30+
/**
31+
* Block registration args loaded from `block.json` file.
32+
*
33+
* @return array
34+
*/
35+
public function get_block_args(): array {
36+
return [];
37+
}
2938
}

composer.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,11 @@
1515
"config": {
1616
"optimize-autoloader": true,
1717
"preferred-install": { "*": "dist" },
18-
"sort-packages": true
18+
"sort-packages": true,
19+
"allow-plugins": {
20+
"phpro/grumphp-shim": true,
21+
"dealerdirect/phpcodesniffer-composer-installer": true
22+
}
1923
},
2024
"require-dev": {
2125
"dealerdirect/phpcodesniffer-composer-installer": "v0.7.1",

0 commit comments

Comments
 (0)