Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // =============================================================================
- // Add Custom Icons to Social Icons list (AFC DEPENDENT)
- // =============================================================================
- function new_x_social_global() {
- $output = '<div class="x-social-global">';
- // Check the AFC Options page for Social Links
- if ( have_rows( 'additional__links', 'option' ) ) :
- while ( have_rows( 'additional__links', 'option' ) ): the_row();
- // Get the vars
- $name = get_sub_field( 'media_name' );
- $slug = strtolower( preg_replace( '/[[:space:]]+/', '-', $name ) );
- $glyph = get_sub_field( 'glyph' );
- $link = get_sub_field( 'profile_url' );
- if ($link == ''){
- $link = '#';
- }
- $output .= '<a href="' . $link . '" class="' . $slug .'" title="' . $name .'" target="blank" rel="noopener noreferrer">';
- $output .= '<i class="x-icon-'. $slug .'" data-x-icon-b="&#x'. $glyph .'" aria-hidden="true"></i></a>';
- endwhile;
- endif;
- return $output;
- }
- add_filter( 'x_social_global_before', 'new_x_social_global' );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement