add_filter( 'wpex_get_social_items', function ( $items ) {
$items['print'] = array(
'site' => 'Print',
'label' => 'Print',
'li_class' => 'custom-print',
'icon_class' => 'ticon ticon-print',
'href' => '#print',
);
return $items;
} );
add_action( 'wp_enqueue_scripts', function() {
$script = '
jQuery( document ).ready(function() {
jQuery( ".wpex-social-share li.custom-print a" ).click( function() {
window.print();
} );
} );';
wp_add_inline_script( 'jquery', $script );
} );
Snippets: Add Print Button to Social Share
All PHP snippets should be added via a child theme's functions.php file or via the Code Snippets Plugin (or alternative plugin)