Rebrand fork as socialiconeco; PHP 8 fix; rename identifiers and fix folder paths

This commit is contained in:
2026-06-29 11:56:46 -03:00
parent 46fbe448bd
commit 451fd0535d
9 changed files with 188 additions and 171 deletions

View File

@@ -1,88 +0,0 @@
.social_icons_widget {
float:left;
margin-bottom:20px;
width:100%;
}
.social_icons_widget label {
display:block;
margin-bottom:5px;
}
.social_icons_widget .social_accounts label {
background-repeat:no-repeat;
padding-left:20px;
}
/* Icons for admin widget */
.social_icons_widget .fivehundredpx { background-image:url('../icons/small/fivehundredpx.jpg'); }
.social_icons_widget .aboutme { background-image:url('../icons/small/aboutme.jpg'); }
.social_icons_widget .behance { background-image:url('../icons/small/behance.jpg'); }
.social_icons_widget .codepen { background-image:url('../icons/small/codepen.jpg'); }
.social_icons_widget .dailymotion { background-image:url('../icons/small/dailymotion.jpg'); }
.social_icons_widget .dribbble { background-image:url('../icons/small/dribbble.jpg'); }
.social_icons_widget .email { background-image:url('../icons/small/email.jpg'); }
.social_icons_widget .envato { background-image:url('../icons/small/envato.jpg'); }
.social_icons_widget .facebook { background-image:url('../icons/small/facebook.jpg'); }
.social_icons_widget .flickr { background-image:url('../icons/small/flickr.jpg'); }
.social_icons_widget .foursquare { background-image:url('../icons/small/foursquare.jpg'); }
.social_icons_widget .github { background-image:url('../icons/small/github.jpg'); }
.social_icons_widget .googleplus { background-image:url('../icons/small/googleplus.jpg'); }
.social_icons_widget .instagram { background-image:url('../icons/small/instagram.jpg'); }
.social_icons_widget .kickstarter { background-image:url('../icons/small/kickstarter.jpg'); }
.social_icons_widget .klout { background-image:url('../icons/small/klout.jpg'); }
.social_icons_widget .linkedin { background-image:url('../icons/small/linkedin.jpg'); }
.social_icons_widget .medium { background-image:url('../icons/small/medium.jpg'); }
.social_icons_widget .path { background-image:url('../icons/small/path.jpg'); }
.social_icons_widget .pinterest { background-image:url('../icons/small/pinterest.jpg'); }
.social_icons_widget .rss { background-image:url('../icons/small/rss.jpg'); }
.social_icons_widget .soundcloud { background-image:url('../icons/small/soundcloud.jpg'); }
.social_icons_widget .speakerdeck { background-image:url('../icons/small/speakerdeck.jpg'); }
.social_icons_widget .stumbleupon { background-image:url('../icons/small/stumbleupon.jpg'); }
.social_icons_widget .technorati { background-image:url('../icons/small/technorati.jpg'); }
.social_icons_widget .tumblr { background-image:url('../icons/small/tumblr.jpg'); }
.social_icons_widget .twitch { background-image:url('../icons/small/twitch.jpg'); }
.social_icons_widget .twitter { background-image:url('../icons/small/twitter.jpg'); }
.social_icons_widget .vimeo { background-image:url('../icons/small/vimeo.jpg'); }
.social_icons_widget .vine { background-image:url('../icons/small/vine.jpg'); }
.social_icons_widget .wordpress { background-image:url('../icons/small/wordpress.jpg'); }
.social_icons_widget .yelp { background-image:url('../icons/small/yelp.jpg'); }
.social_icons_widget .youtube { background-image:url('../icons/small/youtube.jpg'); }
.social_icons_widget .zerply { background-image:url('../icons/small/zerply.jpg'); }
.social_icons_widget .icon_options label,
.social_icons_widget .label_options label {
display:inline;
margin-bottom:0;
}
.widget .widget-inside .icon_options,
.widget .widget-inside .label_options {
margin:0;
padding:0 1.5%;
width:47%;
}
.widget .widget-inside .icon_options { float:left; }
.widget .widget-inside .label_options { float:right; padding-top:3px; }
.social_icons_widget .social_accounts {
border-top:1px #ccc solid;
clear:both;
float:left;
margin-top:1.5em;
padding-top:1.5em;
width:100%;
}
.social_icons_widget .social_accounts li {
border-bottom:1px #ccc dotted;
float:left;
padding:5px 1.5% 15px;
width:30%;
}
.social_icons_widget .social_accounts li .site_icon {
float:left;
margin-right:5px;
}

View File

@@ -1,5 +0,0 @@
.social-icons-widget ul { list-style-type:none; margin:0 0 15px; width:100%; }
.social-icons-widget ul li { display:inline-block; margin:0 6px 10px 0; }
.social-icons-widget ul.show-labels li { display:block; }
.social-icons-widget ul li a { margin:0; }
.social-icons-widget ul.show-labels li img { margin-right:10px; vertical-align:middle; }

View File

@@ -0,0 +1,88 @@
.socialiconeco_widget {
float:left;
margin-bottom:20px;
width:100%;
}
.socialiconeco_widget label {
display:block;
margin-bottom:5px;
}
.socialiconeco_widget .social_accounts label {
background-repeat:no-repeat;
padding-left:20px;
}
/* Icons for admin widget */
.socialiconeco_widget .fivehundredpx { background-image:url('../icons/small/fivehundredpx.jpg'); }
.socialiconeco_widget .aboutme { background-image:url('../icons/small/aboutme.jpg'); }
.socialiconeco_widget .behance { background-image:url('../icons/small/behance.jpg'); }
.socialiconeco_widget .codepen { background-image:url('../icons/small/codepen.jpg'); }
.socialiconeco_widget .dailymotion { background-image:url('../icons/small/dailymotion.jpg'); }
.socialiconeco_widget .dribbble { background-image:url('../icons/small/dribbble.jpg'); }
.socialiconeco_widget .email { background-image:url('../icons/small/email.jpg'); }
.socialiconeco_widget .envato { background-image:url('../icons/small/envato.jpg'); }
.socialiconeco_widget .facebook { background-image:url('../icons/small/facebook.jpg'); }
.socialiconeco_widget .flickr { background-image:url('../icons/small/flickr.jpg'); }
.socialiconeco_widget .foursquare { background-image:url('../icons/small/foursquare.jpg'); }
.socialiconeco_widget .github { background-image:url('../icons/small/github.jpg'); }
.socialiconeco_widget .googleplus { background-image:url('../icons/small/googleplus.jpg'); }
.socialiconeco_widget .instagram { background-image:url('../icons/small/instagram.jpg'); }
.socialiconeco_widget .kickstarter { background-image:url('../icons/small/kickstarter.jpg'); }
.socialiconeco_widget .klout { background-image:url('../icons/small/klout.jpg'); }
.socialiconeco_widget .linkedin { background-image:url('../icons/small/linkedin.jpg'); }
.socialiconeco_widget .medium { background-image:url('../icons/small/medium.jpg'); }
.socialiconeco_widget .path { background-image:url('../icons/small/path.jpg'); }
.socialiconeco_widget .pinterest { background-image:url('../icons/small/pinterest.jpg'); }
.socialiconeco_widget .rss { background-image:url('../icons/small/rss.jpg'); }
.socialiconeco_widget .soundcloud { background-image:url('../icons/small/soundcloud.jpg'); }
.socialiconeco_widget .speakerdeck { background-image:url('../icons/small/speakerdeck.jpg'); }
.socialiconeco_widget .stumbleupon { background-image:url('../icons/small/stumbleupon.jpg'); }
.socialiconeco_widget .technorati { background-image:url('../icons/small/technorati.jpg'); }
.socialiconeco_widget .tumblr { background-image:url('../icons/small/tumblr.jpg'); }
.socialiconeco_widget .twitch { background-image:url('../icons/small/twitch.jpg'); }
.socialiconeco_widget .twitter { background-image:url('../icons/small/twitter.jpg'); }
.socialiconeco_widget .vimeo { background-image:url('../icons/small/vimeo.jpg'); }
.socialiconeco_widget .vine { background-image:url('../icons/small/vine.jpg'); }
.socialiconeco_widget .wordpress { background-image:url('../icons/small/wordpress.jpg'); }
.socialiconeco_widget .yelp { background-image:url('../icons/small/yelp.jpg'); }
.socialiconeco_widget .youtube { background-image:url('../icons/small/youtube.jpg'); }
.socialiconeco_widget .zerply { background-image:url('../icons/small/zerply.jpg'); }
.socialiconeco_widget .icon_options label,
.socialiconeco_widget .label_options label {
display:inline;
margin-bottom:0;
}
.widget .widget-inside .icon_options,
.widget .widget-inside .label_options {
margin:0;
padding:0 1.5%;
width:47%;
}
.widget .widget-inside .icon_options { float:left; }
.widget .widget-inside .label_options { float:right; padding-top:3px; }
.socialiconeco_widget .social_accounts {
border-top:1px #ccc solid;
clear:both;
float:left;
margin-top:1.5em;
padding-top:1.5em;
width:100%;
}
.socialiconeco_widget .social_accounts li {
border-bottom:1px #ccc dotted;
float:left;
padding:5px 1.5% 15px;
width:30%;
}
.socialiconeco_widget .social_accounts li .site_icon {
float:left;
margin-right:5px;
}

View File

@@ -0,0 +1,5 @@
.socialiconeco ul { list-style-type:none; margin:0 0 15px; width:100%; }
.socialiconeco ul li { display:inline-block; margin:0 6px 10px 0; }
.socialiconeco ul.show-labels li { display:block; }
.socialiconeco ul li a { margin:0; }
.socialiconeco ul.show-labels li img { margin-right:10px; vertical-align:middle; }

View File

@@ -1,7 +1,7 @@
<?php <?php
global $siw_social_accounts; global $sie_social_accounts;
foreach ($siw_social_accounts as $site => $id) { foreach ($sie_social_accounts as $site => $id) {
if(!isset($instance[$id])) { $instance[$id] = ''; } if(!isset($instance[$id])) { $instance[$id] = ''; }
elseif($instance[$id] == 'http://') { $instance[$id] = ''; } elseif($instance[$id] == 'http://') { $instance[$id] = ''; }
} }
@@ -12,13 +12,13 @@ if(!isset($instance['labels'])) { $instance['labels'] = ''; }
if(!isset($instance['show_title'])) { $instance['show_title'] = ''; } if(!isset($instance['show_title'])) { $instance['show_title'] = ''; }
?> ?>
<div class="social_icons_widget"> <div class="socialiconeco_widget">
<p><label for="<?php echo $this->get_field_id('title'); ?>">Title:</label> <p><label for="<?php echo $this->get_field_id('title'); ?>">Title:</label>
<input class="widefat" type="text" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" value="<?php echo esc_attr($instance['title']); ?>" /></p> <input class="widefat" type="text" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" value="<?php echo esc_attr($instance['title']); ?>" /></p>
<?php <?php
$siw_sizes = array( $sie_sizes = array(
'None' => 'none', 'None' => 'none',
'Small (16px)' => 'small', 'Small (16px)' => 'small',
'Medium (32px)' => 'medium', 'Medium (32px)' => 'medium',
@@ -32,7 +32,7 @@ $siw_sizes = array(
<p class="icon_options"><label for="<?php echo $this->get_field_id('icons'); ?>">Icon Type:</label> <p class="icon_options"><label for="<?php echo $this->get_field_id('icons'); ?>">Icon Type:</label>
<select id="<?php echo $this->get_field_id('icons'); ?>" name="<?php echo $this->get_field_name('icons'); ?>"> <select id="<?php echo $this->get_field_id('icons'); ?>" name="<?php echo $this->get_field_name('icons'); ?>">
<?php <?php
foreach($siw_sizes as $option => $value) : foreach($sie_sizes as $option => $value) :
if(esc_attr($instance['icons'] == $value)) { $selected = ' selected="selected"'; } if(esc_attr($instance['icons'] == $value)) { $selected = ' selected="selected"'; }
else { $selected = ''; } else { $selected = ''; }
@@ -51,7 +51,7 @@ $siw_sizes = array(
<p class="label_options"><input type="checkbox" id="<?php echo $this->get_field_id('show_title'); ?>" name="<?php echo $this->get_field_name('show_title'); ?>" value="show"<?php echo $checked; ?> /> <label for="<?php echo $this->get_field_id('show_title'); ?>">Hide Title</label></p> <p class="label_options"><input type="checkbox" id="<?php echo $this->get_field_id('show_title'); ?>" name="<?php echo $this->get_field_name('show_title'); ?>" value="show"<?php echo $checked; ?> /> <label for="<?php echo $this->get_field_id('show_title'); ?>">Hide Title</label></p>
<ul class="social_accounts"> <ul class="social_accounts">
<?php foreach ($siw_social_accounts as $site => $id) : ?> <?php foreach ($sie_social_accounts as $site => $id) : ?>
<li><label for="<?php echo $this->get_field_id($id); ?>" class="<?php echo $id; ?>"><?php echo $site; ?>:</label> <li><label for="<?php echo $this->get_field_id($id); ?>" class="<?php echo $id; ?>"><?php echo $site; ?>:</label>
<input class="widefat" type="text" id="<?php echo $this->get_field_id($id); ?>" name="<?php echo $this->get_field_name($id); ?>" value="<?php echo esc_attr($instance[$id]); ?>" placeholder="http://" /></li> <input class="widefat" type="text" id="<?php echo $this->get_field_id($id); ?>" name="<?php echo $this->get_field_name($id); ?>" value="<?php echo esc_attr($instance[$id]); ?>" placeholder="http://" /></li>
<?php endforeach; ?> <?php endforeach; ?>

View File

@@ -2,20 +2,20 @@
/* /*
Declare supported social media websites Declare supported social media websites
By default, the Social Icons Widget provides a variety of popular social media websites. Developers can easily add more social media websites by creating a filter in the active theme's functions.php file like such: By default, Social Icone Co provides a variety of popular social media websites. Developers can easily add more social media websites by creating a filter in the active theme's functions.php file like such:
`function add_new_icons($icon_list) { `function add_new_icons($icon_list) {
$icon_list['Full Website Name'] = 'full-website-id'; $icon_list['Full Website Name'] = 'full-website-id';
return $icon_list; return $icon_list;
} }
add_filter('social_icon_accounts', 'add_new_icons');` add_filter('socialiconeco_accounts', 'add_new_icons');`
The full-website-id should reflect the name of the image you create in each of the icon folder sizes, or in your custom icon directory. It is also used to populate the class field of the icon when the widget displays. The Social Icon Widget looks for .gif, .jpg, .jpeg, and .png in order and returns the first extention it finds. The full-website-id should reflect the name of the image you create in each of the icon folder sizes, or in your custom icon directory. It is also used to populate the class field of the icon when the widget displays. Social Icone Co looks for .gif, .jpg, .jpeg, and .png in order and returns the first extention it finds.
*/ */
global $siw_social_accounts; global $sie_social_accounts;
$siw_social_accounts = array( $sie_social_accounts = array(
'500px' => 'fivehundredpx', '500px' => 'fivehundredpx',
'About.me' => 'aboutme', 'About.me' => 'aboutme',
'Behance' => 'behance', 'Behance' => 'behance',
@@ -51,7 +51,7 @@
'Zerply' => 'zerply' 'Zerply' => 'zerply'
); );
if( has_filter('social_icon_accounts') ) { if( has_filter('socialiconeco_accounts') ) {
$siw_social_accounts = apply_filters('social_icon_accounts', $siw_social_accounts); $sie_social_accounts = apply_filters('socialiconeco_accounts', $sie_social_accounts);
} }
?> ?>

View File

@@ -1,92 +1,92 @@
<?php <?php
global $siw_social_accounts; global $sie_social_accounts;
extract($args); extract($args);
$siw_title = empty($instance['title']) ? 'Follow Us' : apply_filters('widget_title', $instance['title']); $sie_title = empty($instance['title']) ? 'Follow Us' : apply_filters('widget_title', $instance['title']);
$siw_icons = $instance['icons']; $sie_icons = $instance['icons'];
$siw_labels = $instance['labels']; $sie_labels = $instance['labels'];
$siw_show_title = $instance['show_title']; $sie_show_title = $instance['show_title'];
echo $before_widget; echo $before_widget;
if($siw_show_title == '') { if($sie_show_title == '') {
echo $before_title; echo $before_title;
echo $siw_title; echo $sie_title;
echo $after_title; echo $after_title;
} }
if($siw_labels == 'show') { $ul_class = 'show-labels '; } if($sie_labels == 'show') { $ul_class = 'show-labels '; }
else { $ul_class = ''; } else { $ul_class = ''; }
$ul_class .= 'icons-'.$siw_icons; $ul_class .= 'icons-'.$sie_icons;
?> ?>
<?php echo apply_filters('social_icon_opening_tag', '<ul class="'.$ul_class.'">'); ?> <?php echo apply_filters('socialiconeco_opening_tag', '<ul class="'.$ul_class.'">'); ?>
<?php foreach($siw_social_accounts as $siw_title => $id) : ?> <?php foreach($sie_social_accounts as $sie_title => $id) : ?>
<?php if($instance[$id] != '' && $instance[$id] != 'http://') : <?php if($instance[$id] != '' && $instance[$id] != 'http://') :
global $siw_data; global $sie_data;
global $siw_icon_output; global $sie_icon_output;
$imgsize = ''; $imgsize = '';
$siw_data['id'] = $id; $sie_data['id'] = $id;
$siw_data['url'] = $instance[$id]; $sie_data['url'] = $instance[$id];
$siw_custom_sizes = array('custom_small','custom_medium','custom_large'); $sie_custom_sizes = array('custom_small','custom_medium','custom_large');
if (in_array($siw_icons, $siw_custom_sizes)) { if (in_array($sie_icons, $sie_custom_sizes)) {
$size = str_replace("custom_","",$siw_icons); $size = str_replace("custom_","",$sie_icons);
$siw_icon_path = get_stylesheet_directory() .'/social_icons/'.$size.'/'.$id.'.{gif,jpg,jpeg,png}'; $sie_icon_path = get_stylesheet_directory() .'/social_icons/'.$size.'/'.$id.'.{gif,jpg,jpeg,png}';
} }
else { else {
$siw_abs_path = str_replace('lib/', '', plugin_dir_path( __FILE__ )); $sie_abs_path = str_replace('lib/', '', plugin_dir_path( __FILE__ ));
/* Fix for Windows/XAMPP where the slash goes the wrong way. /* Fix for Windows/XAMPP where the slash goes the wrong way.
Thanks to VictoriousK */ Thanks to VictoriousK */
$siw_abs_path = str_replace('\\', '/', $siw_abs_path); $sie_abs_path = str_replace('\\', '/', $sie_abs_path);
$siw_icon_path = $siw_abs_path . 'icons/'.$siw_icons.'/'.$id.'.{gif,jpg,jpeg,png}'; $sie_icon_path = $sie_abs_path . 'icons/'.$sie_icons.'/'.$id.'.{gif,jpg,jpeg,png}';
if($siw_icons == 'large') { $imgsize = 'height="64" width="64"'; } if($sie_icons == 'large') { $imgsize = 'height="64" width="64"'; }
elseif($siw_icons == 'medium') { $imgsize = 'height="32" width="32"'; } elseif($sie_icons == 'medium') { $imgsize = 'height="32" width="32"'; }
elseif($siw_icons == 'small') { $imgsize = 'height="16" width="16"'; } elseif($sie_icons == 'small') { $imgsize = 'height="16" width="16"'; }
} }
$result = glob( $siw_icon_path, GLOB_BRACE ); $result = glob( $sie_icon_path, GLOB_BRACE );
if($result) { if($result) {
if (in_array($siw_icons, $siw_custom_sizes)) { if (in_array($sie_icons, $sie_custom_sizes)) {
$siw_path = explode('themes', $result[0]); $sie_path = explode('themes', $result[0]);
$siw_icon = site_url().'/wp-content/themes'.$siw_path[1]; $sie_icon = site_url().'/wp-content/themes'.$sie_path[1];
} }
else { else {
$siw_path = explode('plugins', $result[0]); $sie_path = explode('plugins', $result[0]);
$siw_icon = plugins_url().''.$siw_path[1]; $sie_icon = plugins_url().''.$sie_path[1];
} }
} }
elseif( $siw_labels != 'show' && $siw_icons != 'small' ) { elseif( $sie_labels != 'show' && $sie_icons != 'small' ) {
$siw_icon = plugins_url().'/social-media-icons-widget/icons/'.$siw_icons.'/_unknown.jpg'; $sie_icon = SIEC_URL.'icons/'.$sie_icons.'/_unknown.jpg';
} }
else { else {
$siw_icon = ''; $sie_icon = '';
} }
if ( $siw_icon ) { $siw_data['image'] = '<img class="site-icon" src="'.$siw_icon.'" alt="'.$siw_title.'" title="'.$siw_title.'" '.$imgsize.' />'; } if ( $sie_icon ) { $sie_data['image'] = '<img class="site-icon" src="'.$sie_icon.'" alt="'.$sie_title.'" title="'.$sie_title.'" '.$imgsize.' />'; }
else { $siw_data['image'] = ''; } else { $sie_data['image'] = ''; }
if($siw_labels != 'show') { $siw_data['title'] = ''; } if($sie_labels != 'show') { $sie_data['title'] = ''; }
else { $siw_data['title'] = '<span class="site-label">'.$siw_title.'</span>'; } else { $sie_data['title'] = '<span class="site-label">'.$sie_title.'</span>'; }
$format = '<li class="%1$s"><a href="%2$s" target="_blank">%3$s%4$s</a></li>'; $format = '<li class="%1$s"><a href="%2$s" target="_blank">%3$s%4$s</a></li>';
$siw_icon_output = apply_filters('social_icon_output', $format); $sie_icon_output = apply_filters('socialiconeco_output', $format);
echo vsprintf($siw_icon_output, $siw_data); echo vsprintf($sie_icon_output, $sie_data);
?> ?>
<?php endif; ?> <?php endif; ?>
<?php endforeach; ?> <?php endforeach; ?>
<?php echo apply_filters('social_icon_closing_tag', '</ul>'); ?> <?php echo apply_filters('socialiconeco_closing_tag', '</ul>'); ?>
<?php <?php
echo $after_widget; echo $after_widget;

View File

@@ -1,8 +1,9 @@
=== Social Icons Widget === === Social Icone Co ===
Contributors: nisbetcreative Contributors: beco
Tags: social, media, widget, follow, profile, icons, 500px, About.me, Behance, Dribbble, Codepen, Email, Envato, Facebook, Flickr, FourSquare, GitHub, Google+, Instagram, Kickstarter, Klout, LinkedIn, Medium, Path, Pinterest, RSS, Speaker Deck, StumbleUpon, Technorati, Tumblr, Twitter, Vimeo, Vine, WordPress, Yelp, YouTube, Zerply Tags: social, media, widget, follow, profile, icons, 500px, About.me, Behance, Dribbble, Codepen, Email, Envato, Facebook, Flickr, FourSquare, GitHub, Google+, Instagram, Kickstarter, Klout, LinkedIn, Medium, Path, Pinterest, RSS, Speaker Deck, StumbleUpon, Technorati, Tumblr, Twitter, Vimeo, Vine, WordPress, Yelp, YouTube, Zerply
Requires at least: 3.5.1 Requires at least: 3.5.1
Tested up to: 4.5 Tested up to: 6.7
Requires PHP: 5.3
Stable tag: 16.07 Stable tag: 16.07
License: GPLv3 or later License: GPLv3 or later
License URI: http://www.gnu.org/licenses/gpl-3.0.html License URI: http://www.gnu.org/licenses/gpl-3.0.html
@@ -11,7 +12,9 @@ Displays a list of social media website icons and a link to your profile.
== Description == == Description ==
The Social Media Icons widget takes a simple, extendable approach to displaying links to your social media profiles in WordPress. The purpose of this plugin was to strip away the complexities I found most other plugins to have and simply display a set of basic social icons in an unordered list. There's no frills and no fanciness, making it easy to style to your website's look. Social Icone Co takes a simple, extendable approach to displaying links to your social media profiles in WordPress. It strips away the complexities of most other plugins and simply displays a set of basic social icons in an unordered list. There's no frills and no fanciness, making it easy to style to your website's look.
Originally based on "Social Icons Widget" by Nisbet Creative (GPLv3), now unmaintained and removed from WordPress.org. Forked and maintained as Social Icone Co, with PHP 8 compatibility restored.
= Icons = = Icons =
@@ -38,33 +41,33 @@ Developers can easily add more social media websites by creating a filter in the
return $icon_list; return $icon_list;
} }
add_filter('social_icon_accounts', 'add_new_icons'); add_filter('socialiconeco_accounts', 'add_new_icons');
The full-website-id should reflect the name of the image you create in each of the icon folder sizes, or in your custom icon directory. It is also used to populate the class field of the icon when the widget displays. The Social Icon Widget looks for .gif, .jpg, .jpeg, and .png in order and returns the first extention it finds. The full-website-id should reflect the name of the image you create in each of the icon folder sizes, or in your custom icon directory. It is also used to populate the class field of the icon when the widget displays. Social Icone Co looks for .gif, .jpg, .jpeg, and .png in order and returns the first extention it finds.
= Altering Widget Output = = Altering Widget Output =
Output of each icon can be adjusted with the social_icon_output filter: Output of each icon can be adjusted with the socialiconeco_output filter:
function social_icons_html_output($format) { function social_icons_html_output($format) {
$format = '<li class="%1$s"><a href="%2$s" target="_blank">%3$s%4$s</a></li>'; $format = '<li class="%1$s"><a href="%2$s" target="_blank">%3$s%4$s</a></li>';
return $format; return $format;
} }
add_filter('social_icon_output', 'social_icons_html_output'); add_filter('socialiconeco_output', 'social_icons_html_output');
The opening and closing unordered list tags can be edited or changed with the social_icon_opening_tag and social_icon_closing_tag filters: The opening and closing unordered list tags can be edited or changed with the socialiconeco_opening_tag and socialiconeco_closing_tag filters:
function social_icons_change_opening($opening) { function social_icons_change_opening($opening) {
$opening = '<ul class="'.$ul_class.'">'; $opening = '<ul class="'.$ul_class.'">';
return $opening; return $opening;
} }
add_filter('social_icon_opening_tag', 'social_icons_change_opening'); add_filter('socialiconeco_opening_tag', 'social_icons_change_opening');
function social_icons_change_closing($closing) { function social_icons_change_closing($closing) {
$closing = '</ul>'; $closing = '</ul>';
return $closing; return $closing;
} }
add_filter('social_icon_closing_tag', 'social_icons_change_closing'); add_filter('socialiconeco_closing_tag', 'social_icons_change_closing');
== Screenshots == == Screenshots ==
@@ -73,6 +76,11 @@ The opening and closing unordered list tags can be edited or changed with the so
== Changelog == == Changelog ==
= 16.07-eco =
* Forked as Social Icone Co from the unmaintained "Social Icons Widget"
* Replaced removed create_function() call for PHP 8 compatibility
* Fixed hardcoded plugin-folder paths so styles and fallback icons load under any folder name
= 16.07 = = 16.07 =
* Updated some social icons to their newer logos * Updated some social icons to their newer logos

View File

@@ -1,19 +1,28 @@
<?php <?php
/* /*
Plugin Name: Social Icons Widget Plugin Name: Social Icone Co
Version: 16.07 Plugin URI: https://code.beco.cc/beco/socialiconeco
Description: Displays a list of social media website icons and a link to your profile. Description: Displays a list of social media website icons and a link to your profile.
Author: Nisbet Creative Version: 16.07
Author: Beco
Author URI: https://beco.cc
License: GPLv3 or later
License URI: http://www.gnu.org/licenses/gpl-3.0.html
Text Domain: socialiconeco
*/ */
class Social_Icons_Widget extends WP_Widget { if ( ! defined( 'SIEC_URL' ) ) {
define( 'SIEC_URL', plugin_dir_url( __FILE__ ) );
}
class Siec_Widget extends WP_Widget {
function __construct() { function __construct() {
parent::__construct( parent::__construct(
'social-icons-widget', // Base ID 'socialiconeco', // Base ID
'Social Icons', // Widget Name 'Social Icone Co', // Widget Name
array( array(
'classname' => 'social-icons-widget', 'classname' => 'socialiconeco',
'description' => 'Displays a list of social media website icons and a link to your profile.', 'description' => 'Displays a list of social media website icons and a link to your profile.',
), ),
array( array(
@@ -33,10 +42,10 @@ class Social_Icons_Widget extends WP_Widget {
} }
function update($new_instance, $old_instance) { function update($new_instance, $old_instance) {
global $siw_social_accounts; global $sie_social_accounts;
$instance = array(); $instance = array();
foreach ($siw_social_accounts as $site => $id) { foreach ($sie_social_accounts as $site => $id) {
$instance[$id] = $new_instance[$id]; $instance[$id] = $new_instance[$id];
} }
@@ -53,15 +62,15 @@ class Social_Icons_Widget extends WP_Widget {
} }
function register_admin_styles() { function register_admin_styles() {
wp_enqueue_style('social-icons-widget-admin', plugins_url('social-media-icons-widget/css/social_icons_admin.css')); wp_enqueue_style('socialiconeco-admin', plugins_url('css/socialiconeco_admin.css', __FILE__));
} }
function register_widget_styles() { function register_widget_styles() {
wp_enqueue_style('social-icons-widget-widget', plugins_url('social-media-icons-widget/css/social_icons_widget.css')); wp_enqueue_style('socialiconeco-widget', plugins_url('css/socialiconeco_widget.css', __FILE__));
} }
} }
add_action('widgets_init', function() { register_widget("Social_Icons_Widget"); } ); add_action('widgets_init', function() { register_widget("Siec_Widget"); } );
?> ?>