Skip to content

Commit e59b0ef

Browse files
committed
gcn-add-page-icon.php: Added filter(s) to add page icon when adding and updating a page.
1 parent 4425281 commit e59b0ef

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

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

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<?php
2+
/**
3+
* Gravity Connect // Notion // Add Page Icon
4+
* https://gravitywiz.com/documentation/gravity-connect-notion/
5+
*
6+
* Notion page POST reference:
7+
* https://developers.notion.com/reference/post-page
8+
*/
9+
10+
add_filter( 'gcn_notion_page_data_add', function( $page_data, $form, $entry, $feed ) {
11+
$page_data['icon'] = array(
12+
'type' => 'emoji',
13+
'emoji' => '🦚',
14+
);
15+
16+
return $page_data;
17+
}, 10, 4 );
18+
19+
add_filter( 'gcn_notion_page_data_update', function( $page_data, $form, $entry, $feed ) {
20+
$page_data['icon'] = array(
21+
'type' => 'emoji',
22+
'emoji' => '🌳',
23+
);
24+
25+
return $page_data;
26+
}, 10, 4 );

0 commit comments

Comments
 (0)