Skip to content

Instantly share code, notes, and snippets.

@pavelrich
Last active October 21, 2021 23:57
Show Gist options
  • Save pavelrich/eb42cc4b2d4e4d20b49a4aca55f75bdb to your computer and use it in GitHub Desktop.
Save pavelrich/eb42cc4b2d4e4d20b49a4aca55f75bdb to your computer and use it in GitHub Desktop.
FORQY Socials — Add/change Social Icons
<?php
if ( ! function_exists( 'prefix_socials_change' ) ) {
/**
* Add/change FORQY Social Icons
*/
function prefix_socials_change( $socials ) {
// Add icon
$socials['new'] = array(
'order' => '1',
'title' => __( 'New', 'textdomain' ),
'url' => 'https://domain.com/',
'icon' => '<svg class="icon" version="1.1" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path class="shape" d="M12,1C5.925,1,1,5.925,1,12s4.925,11,11,11s11-4.925,11-11S18.075,1,12,1z M12,19c-3.866,0-7-3.134-7-7s3.134-7,7-7 s7,3.134,7,7S15.866,19,12,19z"></path></svg>' // 24x24px SVG, PNG, JPG, GIF
);
// Change icon
$socials['facebook']['order'] = '2';
$socials['facebook']['title'] = __( 'Follow Us on Facebook', 'textdomain' );
$socials['facebook']['url'] = 'https://facebook.com/page';
$socials['facebook']['icon'] = '<img src="' . get_template_directory_uri() . '/images/social/facebook.png" alt="' . __( 'Follow Us on Facebook', 'textdomain' ) . '">';
return $socials;
}
add_filter( 'forqy_socials', 'prefix_socials_change', 10, 1 );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment