• Resolved thatwastaxing

    (@thatwastaxing)


    I’ve stumbled upon some issues TML is having with qTranslate here on TML’s WP support and I’d like to add that the tml_user_links filter doesn’t seem to be working either:

    function tml_user_links_filter( $link ) {
        return qtrans_convertURL( $link);
      }
      add_filter( 'tml_user_links', 'tml_user_links_filter');

    This turns all my user links into:

    Warning: strpos() expects parameter 1 to be string, array given in C:\xampp\htdocs\testdev\wp-content\plugins\qtranslate\qtranslate_core.php on line 537

    https://www.ads-software.com/extend/plugins/theme-my-login/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Jeff Farthing

    (@jfarthing84)

    The tml_user_links filter is an array of links. Try this:

    function tml_user_links_filter( $links ) {
    	foreach ( $links as $key => $link ) {
    		$links[$key] = qtrans_convertURL( $link );
    	}
    	return $links;
    }
    add_filter( 'tml_user_links', 'tml_user_links_filter');
    Thread Starter thatwastaxing

    (@thatwastaxing)

    I get:

    Warning: strpos() expects parameter 1 to be string, array given in C:\xampp\htdocs\testdev\wp-content\plugins\qtranslate\qtranslate_core.php on line 537
    
    Warning: preg_match() expects parameter 2 to be string, array given in C:\xampp\htdocs\testdev\wp-content\plugins\qtranslate\qtranslate_utils.php on line 26
    
    Warning: substr() expects parameter 1 to be string, array given in C:\xampp\htdocs\testdev\wp-content\plugins\qtranslate\qtranslate_core.php on line 560
    
    Warning: preg_match() expects parameter 2 to be string, array given in C:\xampp\htdocs\testdev\wp-content\plugins\qtranslate\qtranslate_core.php on line 566
    
    Warning: ltrim() expects parameter 1 to be string, array given in C:\xampp\htdocs\testdev\wp-content\plugins\qtranslate\qtranslate_core.php on line 571
    Plugin Author Jeff Farthing

    (@jfarthing84)

    Ah, I forgot the structure of the user links array myself! Try this:

    function tml_user_links_filter( $links ) {
    	foreach ( $links as $key => $link ) {
    		$links[$key]['url'] = qtrans_convertURL( $link['url'] );
    	}
    	return $links;
    }
    add_filter( 'tml_user_links', 'tml_user_links_filter', 11 );

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘qTranslate issues? Not working with tml_user_links filter’ is closed to new replies.