Documentation

Print This page

How To Change Buttons Style On Different Positions. (Hook)

If you are interested to change the styles of the button for different positions you can do this by applying this simple filter. For example, you want to change the style of sidebar buttons other than inline position,

add_filter( 'ssb_position_style', 'ssb_position_style_cb', 10, 4 );
/**
 * To change the styling of social share buttons on specific location/s.
 * Here you can change the Position of your liking to change the theme at a specific location/s. [ inline, sidebar, flyin, media ].
 * You can select from these theme [ simple-icons, sm-round, simple-round, round-txt, round-btm-border, flat-button-border, round-icon ].
 *
 * @param string $classes All the classes in use.
 * @param string $theme The theme which is currently in use.
 * @param array $extra_data the extra data about buttons.
 * @param array $buttons The buttons to be displayed.
 *
 * @return string $classes The modified classes.
 */
function ssb_position_style_cb( $classes, $theme, $extra_data, $buttons ) {
	if ( $extra_data['position'] == 'media' ) {
		$classes = str_replace( 'simplesocial-' . $theme, 'simplesocial-'.'your-theme', $classes );
	}
	return $classes;
}

Malcare WordPress Security