• Resolved politicske

    (@politicske)


    Hi Robin. I used the “Screen Reader Simulator” extension from Chrome Store and for this plugin’s link, the screen reader reads them as “Facebook-Link, Twitter-Link” etc. How do I target them with something like “Share This Post on Facebook” etc? Enabling icons plus text has no effect as the former.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Robin Cornett

    (@littlerchicken)

    There are multiple filters available in the plugin you can use. If you want the same text for each button, I would try something like this:

    
    add_filter( 'scriptlesssocialsharing_buttons', 'rgc_modify_button_labels' );
    /**
     * Modify the button labels on output. Applies only if the labels are set to
     * not show visually.
     *
     * @param  array $buttons
     * @return array
     */
    function rgc_modify_button_labels( $buttons ) {
    	if ( is_admin() ) {
    		return $buttons;
    	}
    	$style = scriptlesssocialsharing_get_setting( 'button_style' );
    	if ( 0 !== $style ) {
    		return $buttons;
    	}
    	foreach ( $buttons as &$button ) {
    		$button['label'] = 'Share on ' . $button['label'];
    	}
    
    	return $buttons;
    }
    

    This modifies the button label for icon only buttons (since the entire label output is wrapped in a screen reader friendly span). There are other ways you could tackle this, depending on how you would want to modify the output, but this seems the easiest to me. HTH

    Thread Starter politicske

    (@politicske)

    Thanks. This worked. I am trying to make my site as accessibility friendly as possible even if I am not sure how many people with special needs use it. Thanks again.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Screen Reader Text’ is closed to new replies.