Title: Change button class
Last modified: October 8, 2018

---

# Change button class

 *  Resolved [jfkseo](https://wordpress.org/support/users/jfkseo/)
 * (@jfkseo)
 * [7 years, 8 months ago](https://wordpress.org/support/topic/change-button-class-2/)
 * Hi Robin,
 * How can I change the button class -and so it won’t be overwritten with a next
   update?
 * Thanks
    Fred P.S; love the simplicity of the plugin.

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Plugin Author [Robin Cornett](https://wordpress.org/support/users/littlerchicken/)
 * (@littlerchicken)
 * [7 years, 8 months ago](https://wordpress.org/support/topic/change-button-class-2/#post-10761914)
 * Hi Fred! You can do this by using the plugin’s link markup filter. Here’s an 
   example:
 *     ```
       add_filter( 'scriptlesssocialsharing_link_markup', 'prefix_modify_scriptless_button', 10, 2 );
       /**
        * Modify the link output for Scriptless Social Sharing buttons.
        * 
        * @param $output
        * @param $button
        *
        * @return string
        */
       function prefix_modify_scriptless_button( $output, $button ) {
       	$target = 'email' === $button['name'] ? '' : ' target="_blank"';
   
       	return sprintf( '<a class="button %s %s"%s href="%s" rel="noopener" %s><span class="sss-name">%s</span></a>',
       		esc_attr( $button['name'] ),
       		esc_attr( 'my-custom-class' ), // this is where you would put your custom class.
       		$target,
       		esc_url( $button['url'] ),
       		$button['data'],
       		$button['label']
       	);
       }
       ```
   
 * Basically this is an exact copy of the plugin’s original button markup function,
   but with an extra line/class added in (`'my-custom-class'`). Hope this helps 
   you get started.
 *  Thread Starter [jfkseo](https://wordpress.org/support/users/jfkseo/)
 * (@jfkseo)
 * [7 years, 8 months ago](https://wordpress.org/support/topic/change-button-class-2/#post-10767881)
 * Hi Robin,
    Thank you very much for your help ! Fred
    -  This reply was modified 7 years, 8 months ago by [jfkseo](https://wordpress.org/support/users/jfkseo/).

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Change button class’ is closed to new replies.

 * ![](https://ps.w.org/scriptless-social-sharing/assets/icon-256x256.jpg?rev=1361689)
 * [Scriptless Social Sharing](https://wordpress.org/plugins/scriptless-social-sharing/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/scriptless-social-sharing/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/scriptless-social-sharing/)
 * [Active Topics](https://wordpress.org/support/plugin/scriptless-social-sharing/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/scriptless-social-sharing/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/scriptless-social-sharing/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [jfkseo](https://wordpress.org/support/users/jfkseo/)
 * Last activity: [7 years, 8 months ago](https://wordpress.org/support/topic/change-button-class-2/#post-10767881)
 * Status: resolved