Skip to content

Commit

Permalink
2.0.3
Browse files Browse the repository at this point in the history
  • Loading branch information
webmandesign committed Sep 15, 2024
1 parent b11fee4 commit 3af4b3c
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 8 deletions.
11 changes: 11 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
# Receptar Changelog

## 2.0.3, 20240915

### Updated
- Improving and fixing social icons (introducing option to force the icon with `has-icon-#` class)

### File updates
changelog.md
style.css
inc/setup.php


## 2.0.2, 20240902

### Updated
Expand Down
37 changes: 30 additions & 7 deletions inc/setup.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* @copyright 2015 WebMan - Oliver Juhas
*
* @since 1.0.0
* @version 2.0.1
* @version 2.0.3
*
* CONTENT:
* - 10) Actions and filters
Expand Down Expand Up @@ -1000,7 +1000,7 @@ function receptar_menu_social() {
* Social links supported icons
*
* @since 1.6.0
* @version 2.0.1
* @version 2.0.3
*/
function receptar_social_links_icons() {

Expand Down Expand Up @@ -1053,6 +1053,7 @@ function receptar_social_links_icons() {
'wa.me' => 'whatsapp',
'wordpress.org' => 'wordpress',
'wordpress.com' => 'wordpress',
'x.com' => 'x',
'xing.com' => 'xing',
'yelp.com' => 'yelp',
'youtube.com' => 'youtube',
Expand All @@ -1068,7 +1069,7 @@ function receptar_social_links_icons() {
* Display SVG icons in social links menu
*
* @since 1.6.0
* @version 1.6.1
* @version 2.0.3
*
* @param string $item_output The menu item output.
* @param WP_Post $item Menu item object.
Expand All @@ -1092,10 +1093,32 @@ function receptar_nav_menu_social_icons( $item_output, $item, $depth, $args ) {

// Processing

foreach ( $social_icons as $url => $icon ) {
if ( false !== strpos( $item_output, $url ) ) {
$social_icon = $icon;
break;
if (
! empty( $item->classes )
&& false !== stripos( implode( ' ', (array) $item->classes ), 'has-icon-' )
) {

$forced_icon = array_intersect(
$social_icons,
array_map(
function( $item ) {
return str_replace( 'has-icon-', '', trim( $item ) );
},
(array) $item->classes
)
);

if ( ! empty( $forced_icon ) ) {
$social_icon = reset( $forced_icon );
}

} else {

foreach ( $social_icons as $url => $icon ) {
if ( false !== strpos( $item_output, $url ) ) {
$social_icon = $icon;
break;
}
}
}

Expand Down
2 changes: 1 addition & 1 deletion style.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Theme Name: Receptar
Theme URI: https://www.webmandesign.eu/portfolio/receptar-wordpress-theme/
Author: WebMan Design
Author URI: https://www.webmandesign.eu/
Version: 2.0.2
Version: 2.0.3
Text Domain: receptar
Domain Path: /languages
License: GNU General Public License v3
Expand Down

0 comments on commit 3af4b3c

Please sign in to comment.