Skip to content

Commit a1c7410

Browse files
committed
gcn-add-page-icon.php: Updated header annotation with description and more docs.
1 parent eb9e411 commit a1c7410

File tree

2 files changed

+36
-33
lines changed

2 files changed

+36
-33
lines changed
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
<?php
2+
/**
3+
* Gravity Connect // Notion // Add Page Emoji Icon
4+
*
5+
* This snippet demonstrates how to add an emoji icon to a Notion page
6+
* when a form entry is being added to or edited in Notion.
7+
*
8+
* Instructions:
9+
* 1. Modify the filter name to scope as needed.
10+
* * see filter reference for full list of variants: https://gravitywiz.com/documentation/gcn_notion_page_data/)
11+
* 2. Update the $emoji variable to change the icon.
12+
*
13+
* Installation:
14+
* 1. Install per https://gravitywiz.com/documentation/how-do-i-install-a-snippet/
15+
*
16+
* References:
17+
* * GC Notion: https://gravitywiz.com/documentation/gravity-connect-notion/
18+
* * Notion page POST reference: https://developers.notion.com/reference/post-page
19+
*
20+
* @since 1.0-beta-1.9
21+
*/
22+
23+
add_filter( 'gcn_notion_page_data', function( $page_data, $form, $entry, $feed ) {
24+
/**
25+
* Modify the $emoji variable to change the icon.
26+
* Note that the Notion API requires a single emoji character.
27+
*/
28+
$emoji = '🦚';
29+
30+
$page_data['icon'] = array(
31+
'type' => 'emoji',
32+
'emoji' => $emoji,
33+
);
34+
35+
return $page_data;
36+
}, 10, 4 );

gc-notion/gcn-add-page-icon.php

Lines changed: 0 additions & 33 deletions
This file was deleted.

0 commit comments

Comments
 (0)