Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Mat Lipe

    (@mat-lipe)

    Hello designLCN,

    There is way to do it out of the box currently. However if you add the following filter to your active theme’s functions.php file, it may give you the desired result.

    add_filter( 'simple_links_link_output', 'sl_desc_only', 1, 2 );
    function sl_desc_only( $output, $data ){
    	$output = $data[ 'description' ][0];
    	return $output;
    }

    Enjoy!

    Thread Starter designLCN

    (@designlcn)

    Hi thanks,

    that works but i just need to modify one of the widgets not al of them at the same time. I applied “Simple Links” in different sidebars of the homepage and i just need to remove link titles in one of them hooked in a sidebar with ID: ‘footer-1’.
    I need a conditional to just hook ‘footer-1’ sidebar with the filter you provided. Is it possible?

    Thanks,

    Plugin Author Mat Lipe

    (@mat-lipe)

    Hello,

    There is a creative way to do this where we hook into a filter that knows the id of the widget area and based on the id we either register or unregister the description filter.

    This may do the trick:

    add_filter( 'simple_links_widget_args', 'maybe_sl_desc_only' );
    function maybe_sl_desc_only( $args ){
    	if( $args[ 'id' ] == 'footer-1' ){
    		add_filter( 'simple_links_link_output', 'sl_desc_only', 1, 2 );
    	} else {
    		remove_filter( 'simple_links_link_output', 'sl_desc_only', 1 );
    	}
    	return $args;
    }
    function sl_desc_only( $output, $data ){
    	$output = $data[ 'description' ][0];
    	return $output;
    }

    Thread Starter designLCN

    (@designlcn)

    Hi Mat,

    perfect that works. Many thanks!

    Regards,

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Turn off link title texts links in titles’ is closed to new replies.