Skip to content

Commit 1883bec

Browse files
committed
(feat): personal data blocks
1 parent d5970f5 commit 1883bec

File tree

32 files changed

+14302
-186
lines changed

32 files changed

+14302
-186
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22

33
- Tested up to: WordPress 6.3.2
44

5+
## v1.2.0
6+
7+
### Feat
8+
9+
- Personal data blocks
10+
511
## v1.1
612

713
### Feat

TODO.md

Lines changed: 0 additions & 6 deletions
This file was deleted.
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"$schema": "https://schemas.wp.org/trunk/block.json",
3+
"apiVersion": 3,
4+
"name": "prefill-gravity-forms/personal-data-table",
5+
"version": "0.1.0",
6+
"title": "Profielpagina",
7+
"category": "embed",
8+
"icon": "list-view",
9+
"description": "Maak een profielpagina met persoonsgegevens van de ingelogde gebruiker.",
10+
"example": {},
11+
"supports": {
12+
"html": false
13+
},
14+
"textdomain": "prefill-gravity-forms",
15+
"editorScript": "file:./index.js"
16+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<?php return array('dependencies' => array('react', 'wp-block-editor', 'wp-blocks'), 'version' => '33a4b45f8eec02c31038');

build/personal-data-table/index.js

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
{
2+
"$schema": "https://schemas.wp.org/trunk/block.json",
3+
"apiVersion": 3,
4+
"name": "prefill-gravity-forms/personal-data-row",
5+
"version": "0.1.0",
6+
"title": "Persoonsgegevens",
7+
"category": "embed",
8+
"icon": "id",
9+
"description": "Toon persoonsgegevens van de ingelogde gebruiker.",
10+
"example": {},
11+
"supports": {
12+
"html": false
13+
},
14+
"attributes": {
15+
"selectedOption": {
16+
"type": "object",
17+
"default": {
18+
"value": "",
19+
"label": ""
20+
}
21+
},
22+
"isChildOfTable": {
23+
"type": "boolean",
24+
"default": false
25+
},
26+
"htmlElement": {
27+
"type": "string",
28+
"default": "p"
29+
}
30+
},
31+
"textdomain": "prefill-gravity-forms",
32+
"editorScript": "file:./index.js",
33+
"render": "file:./render.php"
34+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<?php return array('dependencies' => array('react', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-data', 'wp-element', 'wp-i18n'), 'version' => '010cb8fb1bb4a49a86fa');

build/personal-data-table/personal-data-row/index.js

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?php
2+
3+
use OWC\PrefillGravityForms\Services\PersonalDataService;
4+
5+
if ($attributes['isChildOfTable']) : ?>
6+
<tr>
7+
<th><?php echo $attributes['selectedOption']['label'] ?></th>
8+
<td><?php echo (new PersonalDataService())->get($attributes['selectedOption']['value'])?></td>
9+
</tr>
10+
<?php else :
11+
echo sprintf(
12+
"<%s>%s</%s>",
13+
$attributes['htmlElement'] ?? 'p',
14+
(new PersonalDataService())->get($attributes['selectedOption']['value']),
15+
$attributes['htmlElement'] ?? 'p'
16+
);
17+
endif;

config/core.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
'providers' => [
77
// Global providers.
88
OWC\PrefillGravityForms\GravityForms\GravityFormsServiceProvider::class,
9+
OWC\PrefillGravityForms\Blocks\BlockServiceProvider::class,
910
],
1011

1112
/**

0 commit comments

Comments
 (0)