@@ -14,7 +14,7 @@ To install the WordPress plugin, follow these instructions:
14
14
``` bash
15
15
git clone
[email protected] :GravityKit/DataKit.git DataKit
16
16
```
17
-
17
+
18
18
2. Symlink your repository to your WordPress' `wp-content/plugins` folder (Not required if you cloned it there directly)
19
19
20
20
```bash
@@ -24,13 +24,22 @@ To install the WordPress plugin, follow these instructions:
24
24
25
25
3. Go into the folder and perform a Composer install
26
26
```bash
27
- composer install --no-dev -o
27
+ composer install --no-dev
28
28
```
29
29
30
30
4. Go to your WordPress installation, and activate the DataKit plugin.
31
31
32
32
## Creating a DataView
33
33
34
+ In order to register the DataView, you need to wait until the `datakit/loaded` action hook was dispatched. After this,
35
+ you can be certain DataKit was loaded and the default data sources and fields are available to use.
36
+
37
+ ```php
38
+ add_action( ' datakit/loaded' , function () {
39
+ // Create your DataView here.
40
+ } );
41
+ ```
42
+
34
43
DataKit provides a fluent PHP API for creating `DataView` objects. A `DataView` consists of a `DataSource` and a set of
35
44
`Fields`. To learn more about the different field types, please see our [Documentation](SDK/Fields/using-fields).
36
45
@@ -61,4 +70,5 @@ DataKit provides a fluent PHP API for creating `DataView` objects. A `DataView`
61
70
```php
62
71
do_action( ' datakit/dataview/register' , $dataview );
63
72
```
64
- 4. Show off your `DataView`! You can use the `[dataview id="my-dataview"]` shortcode to display your `DataView` anywhere.
73
+ 4. Show off your `DataView`! You can use the `[dataview id="my-dataview"]` shortcode to display your `DataView`
74
+ anywhere.
0 commit comments