Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions gc-notion/gcn-add-page-emoji-icon.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<?php
/**
* Gravity Connect // Notion // Add Page Emoji Icon
*
* This snippet demonstrates how to add an emoji icon to a Notion page
* when a form entry is being added to or edited in Notion.
*
* Instructions:
* 1. Modify the filter name to scope as needed.
* * see filter reference for full list of variants: https://gravitywiz.com/documentation/gcn_notion_page_data/)
* 2. Update the $emoji variable to change the icon.
*
* Installation:
* 1. Install per https://gravitywiz.com/documentation/how-do-i-install-a-snippet/
*
* References:
* * GC Notion: https://gravitywiz.com/documentation/gravity-connect-notion/
* * Notion page POST reference: https://developers.notion.com/reference/post-page
*
* @since 1.0-beta-1.9
*/

add_filter( 'gcn_notion_page_data', function( $page_data, $form, $entry, $feed ) {
/**
* Modify the $emoji variable to change the icon.
* Note that the Notion API requires a single emoji character.
*/
$emoji = '🦚';

$page_data['icon'] = array(
'type' => 'emoji',
'emoji' => $emoji,
);

return $page_data;
}, 10, 4 );
Loading