You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: extending-aql.md
+24-3Lines changed: 24 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,16 +14,36 @@ For example, a control that makes changes to the content types being displayed m
14
14
15
15
Both SlotFills are passed all `props` from the main block and are available on the `window.aql` object for use.
16
16
17
-
The example below adds a new control to only show content from the from currently logged in user regardless of the status of `Inherit query from template`.
17
+
##### Available props
18
+
19
+
In addition to the standard block props (`attributes`, `setAttributes`, `clientId`, etc.), every component receives an enriched `context` object with the following values:
20
+
21
+
| Property | Type | Description |
22
+
|---|---|---|
23
+
|`context.currentPostId`|`number`| The ID of the post or page currently open in the editor. Returns `0` when editing a template. |
24
+
|`context.currentPostType`|`string`| The post type of the currently edited entity, e.g. `'post'`, `'page'`, or `'wp_template'`. |
25
+
26
+
Any other context values that `core/query` already receives from its parent are also preserved.
0 commit comments