Skip to content

Instantly share code, notes, and snippets.

@dlxsnippets
Last active April 6, 2024 08:21
Show Gist options
  • Save dlxsnippets/53c83e13743c11fb1a25d6652551b98f to your computer and use it in GitHub Desktop.
Save dlxsnippets/53c83e13743c11fb1a25d6652551b98f to your computer and use it in GitHub Desktop.
Sample Blueprint File for Highlight and Share
{
"$schema": "https://playground.wordpress.net/blueprint-schema.json",
"preferredVersions": {
"php": "8.0",
"wp": "6.5"
},
"features": {
"networking": true
},
"phpExtensionBundles": [
"kitchen-sink"
],
"landingPage": "/highlight-and-share-demo/",
"steps": [
{
"step": "login",
"username": "admin",
"password": "password"
},
{
"step": "setSiteOptions",
"options": {
"permalink_structure": "/%postname%/"
}
},
{
"step": "runPHP",
"code": "<?php require_once 'wordpress/wp-load.php'; update_option( 'highlight-and-share-block-editor-options', maybe_unserialize( 'a:12:{s:13:\"enable_blocks\";b:1;s:18:\"enable_adobe_fonts\";b:0;s:16:\"adobe_project_id\";s:0:\"\";s:26:\"enable_inline_highlighting\";b:1;s:33:\"inline_highlight_background_color\";s:7:\"#ffefb1\";s:39:\"inline_highlight_background_color_hover\";s:7:\"#fcd63c\";s:27:\"inline_highlight_text_color\";s:7:\"#000000\";s:33:\"inline_highlight_text_color_hover\";s:7:\"#000000\";s:30:\"inline_highlight_tooltips_text\";s:29:\"Click to Share This Highlight\";s:30:\"inline_highlight_show_tooltips\";b:1;s:42:\"inline_highlight_tooltips_background_color\";s:7:\"#000000\";s:36:\"inline_highlight_tooltips_text_color\";s:7:\"#FFFFFF\";}' ) ); ?>"
},
{
"step": "runPHP",
"code": "<?php require_once 'wordpress/wp-load.php'; update_option( 'highlight-and-share', maybe_unserialize( 'a:51:{s:13:\"enable_mobile\";b:1;s:14:\"enable_content\";b:1;s:14:\"enable_excerpt\";b:1;s:14:\"sharing_prefix\";s:0:\"\";s:14:\"sharing_suffix\";s:0:\"\";s:12:\"show_twitter\";b:1;s:7:\"twitter\";s:11:\"mediaronllc\";s:15:\"enable_hashtags\";b:0;s:13:\"show_facebook\";b:1;s:14:\"show_whats_app\";b:1;s:22:\"whats_app_api_endpoint\";s:3:\"app\";s:11:\"show_reddit\";b:0;s:13:\"show_telegram\";b:0;s:13:\"show_linkedin\";b:0;s:9:\"show_xing\";b:0;s:9:\"show_copy\";b:1;s:13:\"show_mastodon\";b:0;s:14:\"mastodon_label\";s:8:\"Mastodon\";s:16:\"mastodon_tooltip\";s:17:\"Share on Mastodon\";s:13:\"enable_emails\";b:1;s:10:\"shortlinks\";b:0;s:10:\"js_content\";s:0:\"\";s:15:\"element_content\";s:0:\"\";s:10:\"id_content\";s:0:\"\";s:15:\"wrapper_classes\";s:0:\"\";s:13:\"twitter_label\";s:10:\"Share This\";s:15:\"twitter_tooltip\";s:10:\"Share on X\";s:14:\"facebook_label\";s:8:\"Facebook\";s:16:\"facebook_tooltip\";s:17:\"Share on Facebook\";s:14:\"whatsapp_label\";s:8:\"WhatsApp\";s:16:\"whatsapp_tooltip\";s:17:\"Share on WhatsApp\";s:12:\"reddit_label\";s:6:\"Reddit\";s:14:\"reddit_tooltip\";s:15:\"Share on Reddit\";s:14:\"telegram_label\";s:8:\"Telegram\";s:16:\"telegram_tooltip\";s:17:\"Share on Telegram\";s:14:\"linkedin_label\";s:8:\"LinkedIn\";s:16:\"linkedin_tooltip\";s:17:\"Share on LinkedIn\";s:10:\"xing_label\";s:4:\"Xing\";s:12:\"xing_tooltip\";s:13:\"Share on Xing\";s:10:\"copy_label\";s:4:\"Copy\";s:12:\"copy_tooltip\";s:14:\"Copy Selection\";s:11:\"email_label\";s:5:\"Email\";s:13:\"email_tooltip\";s:15:\"Share via email\";s:11:\"show_tumblr\";b:0;s:12:\"tumblr_label\";s:6:\"Tumblr\";s:14:\"tumblr_tooltip\";s:15:\"Share on Tumblr\";s:13:\"show_webshare\";b:1;s:14:\"webshare_label\";s:5:\"Share\";s:16:\"webshare_tooltip\";s:10:\"Share This\";s:32:\"enable_webshare_inline_highlight\";b:0;s:30:\"enable_webshare_click_to_share\";b:0;}' ) ); ?>"
},
{
"step": "runPHP",
"code": "<?php require_once 'wordpress/wp-load.php'; update_option( 'highlight-and-share-theme-options', maybe_unserialize( 'a:18:{s:5:\"theme\";s:6:\"custom\";s:10:\"icons_only\";b:1;s:11:\"orientation\";s:10:\"horizontal\";s:11:\"group_icons\";b:0;s:16:\"background_color\";s:7:\"#000000\";s:22:\"background_color_hover\";s:7:\"#333333\";s:17:\"icon_colors_group\";s:7:\"#FFFFFF\";s:23:\"icon_colors_group_hover\";s:7:\"#FFFFFF\";s:19:\"border_radius_group\";a:6:{s:7:\"attrTop\";s:3:\"100\";s:9:\"attrRight\";s:3:\"100\";s:10:\"attrBottom\";s:3:\"100\";s:8:\"attrLeft\";s:3:\"100\";s:8:\"attrUnit\";s:1:\"%\";s:13:\"attrSyncUnits\";b:1;}s:18:\"icon_border_radius\";a:6:{s:7:\"attrTop\";s:2:\"48\";s:9:\"attrRight\";s:2:\"48\";s:10:\"attrBottom\";s:2:\"48\";s:8:\"attrLeft\";s:2:\"48\";s:13:\"attrSyncUnits\";b:1;s:8:\"attrUnit\";s:1:\"%\";}s:12:\"icon_padding\";a:6:{s:7:\"attrTop\";s:2:\"15\";s:9:\"attrRight\";s:2:\"15\";s:10:\"attrBottom\";s:2:\"15\";s:8:\"attrLeft\";s:2:\"15\";s:13:\"attrSyncUnits\";b:1;s:8:\"attrUnit\";s:2:\"px\";}s:9:\"icon_size\";s:2:\"30\";s:9:\"font_size\";s:2:\"14\";s:8:\"icon_gap\";s:2:\"12\";s:11:\"icon_colors\";a:12:{s:7:\"twitter\";a:6:{s:5:\"label\";s:1:\"X\";s:4:\"slug\";s:7:\"twitter\";s:10:\"background\";s:4:\"#333\";s:16:\"background_hover\";s:4:\"#333\";s:10:\"icon_color\";s:7:\"#ffffff\";s:16:\"icon_color_hover\";s:7:\"#ffffff\";}s:8:\"facebook\";a:6:{s:5:\"label\";s:8:\"Facebook\";s:4:\"slug\";s:8:\"facebook\";s:10:\"background\";s:7:\"#3b5998\";s:16:\"background_hover\";s:7:\"#2d4373\";s:10:\"icon_color\";s:4:\"#fff\";s:16:\"icon_color_hover\";s:4:\"#fff\";}s:8:\"whatsapp\";a:6:{s:5:\"label\";s:8:\"WhatsApp\";s:4:\"slug\";s:8:\"whatsapp\";s:10:\"background\";s:7:\"#25d366\";s:16:\"background_hover\";s:7:\"#1fbf4f\";s:10:\"icon_color\";s:4:\"#fff\";s:16:\"icon_color_hover\";s:4:\"#fff\";}s:6:\"reddit\";a:6:{s:5:\"label\";s:6:\"Reddit\";s:4:\"slug\";s:6:\"reddit\";s:10:\"background\";s:7:\"#ff4500\";s:16:\"background_hover\";s:7:\"#e63f00\";s:10:\"icon_color\";s:4:\"#fff\";s:16:\"icon_color_hover\";s:4:\"#fff\";}s:8:\"telegram\";a:6:{s:5:\"label\";s:8:\"Telegram\";s:4:\"slug\";s:8:\"telegram\";s:10:\"background\";s:7:\"#0088cc\";s:16:\"background_hover\";s:7:\"#006b9f\";s:10:\"icon_color\";s:4:\"#fff\";s:16:\"icon_color_hover\";s:4:\"#fff\";}s:8:\"mastodon\";a:6:{s:5:\"label\";s:8:\"Mastodon\";s:4:\"slug\";s:8:\"mastodon\";s:10:\"background\";s:7:\"#605CF5\";s:16:\"background_hover\";s:7:\"#4c49c3\";s:10:\"icon_color\";s:4:\"#fff\";s:16:\"icon_color_hover\";s:4:\"#fff\";}s:6:\"tumblr\";a:6:{s:5:\"label\";s:6:\"Tumblr\";s:4:\"slug\";s:6:\"tumblr\";s:10:\"background\";s:7:\"#000000\";s:16:\"background_hover\";s:7:\"#333333\";s:10:\"icon_color\";s:4:\"#fff\";s:16:\"icon_color_hover\";s:4:\"#fff\";}s:8:\"linkedin\";a:6:{s:5:\"label\";s:8:\"LinkedIn\";s:4:\"slug\";s:8:\"linkedin\";s:10:\"background\";s:7:\"#0077b5\";s:16:\"background_hover\";s:7:\"#005983\";s:10:\"icon_color\";s:4:\"#fff\";s:16:\"icon_color_hover\";s:4:\"#fff\";}s:4:\"xing\";a:6:{s:5:\"label\";s:4:\"Xing\";s:4:\"slug\";s:4:\"xing\";s:10:\"background\";s:7:\"#006567\";s:16:\"background_hover\";s:7:\"#004c4c\";s:10:\"icon_color\";s:4:\"#fff\";s:16:\"icon_color_hover\";s:4:\"#fff\";}s:4:\"copy\";a:6:{s:5:\"label\";s:4:\"Copy\";s:4:\"slug\";s:4:\"copy\";s:10:\"background\";s:4:\"#000\";s:16:\"background_hover\";s:4:\"#000\";s:10:\"icon_color\";s:4:\"#fff\";s:16:\"icon_color_hover\";s:4:\"#fff\";}s:5:\"email\";a:6:{s:5:\"label\";s:5:\"Email\";s:4:\"slug\";s:5:\"email\";s:10:\"background\";s:7:\"#8364E8\";s:16:\"background_hover\";s:7:\"#734eec\";s:10:\"icon_color\";s:4:\"#fff\";s:16:\"icon_color_hover\";s:4:\"#fff\";}s:8:\"webshare\";a:6:{s:5:\"label\";s:5:\"Share\";s:4:\"slug\";s:8:\"webshare\";s:10:\"background\";s:7:\"#f58f2f\";s:16:\"background_hover\";s:7:\"#e17713\";s:10:\"icon_color\";s:4:\"#fff\";s:16:\"icon_color_hover\";s:4:\"#fff\";}}s:13:\"show_tooltips\";b:1;s:19:\"tooltips_text_color\";s:7:\"#FFFFFF\";s:25:\"tooltips_background_color\";s:7:\"#000000\";}' ) ); ?>"
},
{
"step": "runPHP",
"code": "<?php require_once 'wordpress/wp-load.php'; update_option( 'highlight-and-share-email-settings', maybe_unserialize( 'a:12:{s:21:\"enable_logged_in_only\";b:0;s:15:\"akismet_enabled\";b:0;s:17:\"recaptcha_enabled\";b:0;s:18:\"recaptcha_site_key\";s:0:\"\";s:20:\"recaptcha_secret_key\";s:0:\"\";s:25:\"recaptcha_score_threshold\";s:3:\"0.5\";s:9:\"from_name\";s:20:\"My WordPress Website\";s:10:\"from_email\";s:19:\"[email protected]\";s:15:\"email_send_type\";s:4:\"form\";s:13:\"email_subject\";s:48:\"Check out this {{share_type}} from {{site_name}}\";s:10:\"email_body\";s:110:\"{{from_name}} ({{from_email}}) wants to share a link with you\r\n\n{{share_text}}\r\n\r\n{{post_title}}\r\n{{post_url}}\";s:17:\"email_modal_title\";s:25:\"Share this {{share_type}}\";}' ) ); ?>"
},
{
"step": "runPHP",
"code": "<?php require_once 'wordpress/wp-load.php'; wp_insert_post(array('post_title' => 'Highlight and Share Demo', 'post_status' => 'publish', 'post_content' => '<!-- wp:paragraph --><p>Welcome to the Highlight and Share demo.</p><!-- /wp:paragraph --><!-- wp:paragraph --><p>You can highlight any of this text and you will see several social sharing networks.</p><!-- /wp:paragraph --><!-- wp:has/click-to-share {\"uniqueId\":\"has-cts-0\",\"showClickToShare\":-1,\"showIcon\":-1,\"iconSize\":24,\"iconSizeResponsive\":{\"mobile\":30,\"tablet\":25,\"desktop\":30},\"backgroundColor\":\"#8364E8\",\"backgroundColorHover\":\"#6f4ae6\",\"backgroundColorSync\":\"hover\",\"icon\":\"\",\"iconColor\":\"#fbd110\",\"iconColorHover\":\"#fbd110\",\"iconColorSync\":\"sync\",\"textColor\":\"#ffffff\",\"textColorHover\":\"#ffffff\",\"textColorSync\":\"sync\",\"shareTextColor\":\"#fbd110\",\"shareTextColorHover\":\"#fbd110\",\"shareTextColorSync\":\"sync\",\"borderRadius\":-1,\"borderColor\":\"#7b5be6\",\"borderColorHover\":\"#7b5be6\",\"borderColorSync\":\"sync\",\"maximumWidth\":{\"mobile\":{\"width\":\"95\",\"unit\":\"vw\"},\"tablet\":{\"width\":\"95\",\"unit\":\"%\"},\"desktop\":{\"width\":\"650\",\"unit\":\"px\"}},\"showClickToShareText\":{\"mobile\":false,\"tablet\":true,\"desktop\":true},\"showClickToShareIcon\":{\"mobile\":true,\"tablet\":true,\"desktop\":false},\"alignment\":\"none\",\"marginTop\":-1,\"paddingSize\":{\"mobile\":{\"top\":\"\",\"right\":\"\",\"bottom\":\"\",\"left\":\"\",\"unit\":null,\"unitSync\":null},\"tablet\":{\"top\":\"\",\"right\":\"\",\"bottom\":\"\",\"left\":\"\",\"unit\":null,\"unitSync\":null},\"desktop\":{\"top\":\"30\",\"right\":\"30\",\"bottom\":\"30\",\"left\":\"30\",\"unit\":\"px\",\"unitSync\":true}},\"marginSize\":{\"mobile\":{\"top\":\"0\",\"right\":\"\",\"bottom\":\"0\",\"left\":\"\",\"unit\":null,\"unitSync\":null},\"tablet\":{\"top\":\"5\",\"right\":\"\",\"bottom\":\"5\",\"left\":\"\",\"unit\":null,\"unitSync\":null},\"desktop\":{\"top\":\"20\",\"right\":0,\"bottom\":\"20\",\"left\":0,\"unit\":\"px\",\"unitSync\":false}},\"borderRadiusSize\":{\"mobile\":{\"top\":\"\",\"right\":\"\",\"bottom\":\"\",\"left\":\"\",\"unit\":null,\"unitSync\":null},\"tablet\":{\"top\":\"\",\"right\":\"\",\"bottom\":\"\",\"left\":\"\",\"unit\":null,\"unitSync\":null},\"desktop\":{\"top\":\"5\",\"right\":\"5\",\"bottom\":\"5\",\"left\":\"5\",\"unit\":\"px\",\"unitSync\":true}},\"typographyQuote\":{\"mobile\":{\"fontFamily\":\"\",\"fontFamilySlug\":\"\",\"fontSize\":\"\",\"fontSizeUnit\":\"px\",\"fontWeight\":\"\",\"lineHeight\":\"\",\"lineHeightUnit\":\"em\",\"textTransform\":\"\",\"letterSpacing\":\"\",\"letterSpacingUnit\":\"px\",\"fontType\":\"web\",\"fontFallback\":\"\"},\"tablet\":{\"fontFamily\":\"\",\"fontFamilySlug\":\"\",\"fontSize\":\"\",\"fontSizeUnit\":\"px\",\"fontWeight\":\"\",\"lineHeight\":\"\",\"lineHeightUnit\":\"em\",\"textTransform\":\"\",\"letterSpacing\":\"\",\"letterSpacingUnit\":\"px\",\"fontType\":\"web\",\"fontFallback\":\"\"},\"desktop\":{\"fontFamily\":\"Lato\",\"fontFamilySlug\":\"lato\",\"fontSize\":\"31\",\"fontSizeUnit\":\"px\",\"fontWeight\":\"normal\",\"lineHeight\":\"1.3\",\"lineHeightUnit\":\"em\",\"textTransform\":\"none\",\"letterSpacing\":\"0\",\"letterSpacingUnit\":\"px\",\"fontType\":\"google\",\"fontFallback\":\"Helvetica, Arial, sans-serif\"}},\"typographyShareText\":{\"mobile\":{\"fontFamily\":\"\",\"fontFamilySlug\":\"\",\"fontSize\":\"\",\"fontSizeUnit\":\"px\",\"fontWeight\":\"\",\"lineHeight\":\"\",\"lineHeightUnit\":\"em\",\"textTransform\":\"\",\"letterSpacing\":\"\",\"letterSpacingUnit\":\"px\",\"fontType\":\"web\",\"fontFallback\":\"sans-serif\"},\"tablet\":{\"fontFamily\":\"\",\"fontFamilySlug\":\"\",\"fontSize\":\"\",\"fontSizeUnit\":\"px\",\"fontWeight\":\"\",\"lineHeight\":\"\",\"lineHeightUnit\":\"em\",\"textTransform\":\"\",\"letterSpacing\":\"\",\"letterSpacingUnit\":\"px\",\"fontType\":\"web\",\"fontFallback\":\"sans-serif\"},\"desktop\":{\"fontFamily\":\"Lato\",\"fontFamilySlug\":\"lato\",\"fontSize\":\"28\",\"fontSizeUnit\":\"px\",\"fontWeight\":\"400\",\"lineHeight\":\"1.3\",\"lineHeightUnit\":\"em\",\"textTransform\":\"none\",\"letterSpacing\":\"0\",\"letterSpacingUnit\":\"px\",\"fontType\":\"google\",\"fontFallback\":\"Helvetica, Arial, sans-serif\"}}} --><!-- wp:paragraph {\"placeholder\":\"\"} --><p>You can click me to show social networks as well. I am a Click to Share block.</p><!-- /wp:paragraph --><!-- /wp:has/click-to-share --><!-- wp:paragraph --><p>You are also able to inline highlight text. This is <span class=\"has-inline-text has-inline-text\">a quick example of inline highlighting</span>, which you can click on. Do not worry, nothing bad will happen.</p><!-- /wp:paragraph --><!-- wp:paragraph --><p>When you are ready, <a href=\"/wp-admin/options-general.php?page=highlight-and-share\">head to the admin settings</a> so you can see the many ways to configure this plugin.</p><!-- /wp:paragraph -->')); ?>"
}
]
}
@dlxsnippets
Copy link
Author

Sample Blueprint.json for Highlight and Share, demonstrating inserting complex options and pattern data.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment