Skip to content

Commit

Permalink
✨ Support outermost/social-sharing-link block.
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrissiQ committed Feb 8, 2023
1 parent 67e10e4 commit c81238a
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 7 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "replace-social-services-icons",
"version": "0.1.1",
"version": "0.2.0",
"author": "Evans Hunt",
"description": "",
"scripts": {
Expand Down
9 changes: 6 additions & 3 deletions replace-social-services-icons.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

/**
* Plugin Name: Replace Social Services Icons
* Version: 0.1.1
* Version: 0.2.0
*/

class Replace_Social_Services_Icons
{
private static $version = '0.1.1';
private static $version = '0.2.0';

private static function replace_icons(string $block_content, array $block, string $dir, $settings)
{
Expand Down Expand Up @@ -89,7 +89,10 @@ public static function render_block_hook(string $block_content, array $block)
return $block_content;
}

if ($block['blockName'] === 'core/social-link') {
if (in_array($block['blockName'], [
'core/social-link',
'outermost/social-sharing-link',
])) {
return self::replace_icons($block_content, $block, $dir, $settings);
}

Expand Down
6 changes: 5 additions & 1 deletion src/replace-icons.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@ function replaceIcon(variations, serviceName, icon) {
}

function filterSocialLinkIcons(settings, name) {
if (name === 'core/social-link') {
if ([
'core/social-link',
'outermost/social-sharing-link',
].includes(name)
) {
const { variations } = settings;
const services = themeData?.settings?.services;
for (const service in services) {
Expand Down

0 comments on commit c81238a

Please sign in to comment.