Viewing 3 replies - 1 through 3 (of 3 total)
  • Also curious how to remove the text after each icon. Those text strings seem pretty tightly bound up in the functions, but hopefully there’s an easy alternative.

    Awesome plugin, by the way, and simple enough to be able to modify fairly easily (…except for this icon text issue!).

    How to translate the text before the links is a question iI’d like to know a solution for it too ??

    As we use Polylang the solution would be to use the possibility to register a textstring like explained here: https://polylang.wordpress.com/documentation/documentation-for-developers/functions-reference/

    pll_register_string($name, $string, $group, $multiline);

    I’m just not sure how to make sure that it doesn’t throw an error when polylang doesn’t exist.

    I tried like this (in the class-admin.php file), but this was not working:

    public function sanitize_settings( $settings ) {
    
    		$settings['before_text'] = strip_tags( $settings['before_text'], '<a><strong><i><em><b><span>' );
    		$settings['icon_size'] = trim( absint( $settings['icon_size'] ) );
    		$settings['twitter_username'] = trim( strip_tags( $settings['twitter_username'] ) );
    		$settings['auto_add_post_types'] = ( isset( $settings['auto_add_post_types'] ) ) ? $settings['auto_add_post_types'] : array();
    
            /**
             * Check for Polylang, when exist, make the strings translatable here
             */
            if ( function_exists( 'pll_register_string' ) ) {
    
                pll_register_string( 'pl_before_text', $settings['before_text'], 'dvk-social-sharing' );
    
            }	
    
    		return $settings;
    	}

    Any hints on how this could be accomplished would be highly appreciated

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Disabling social network titles and translation for text that appears on site’ is closed to new replies.