WordPress.org

Ready to get started?Download WordPress

Forums

Theme My Login
[resolved] qTranslate issues? Not working with tml_user_links filter (4 posts)

  1. thatwastaxing
    Member
    Posted 1 year ago #

    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

    http://wordpress.org/extend/plugins/theme-my-login/

  2. Jeff Farthing
    Member
    Plugin Author

    Posted 1 year ago #

    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');
  3. thatwastaxing
    Member
    Posted 1 year ago #

    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
  4. Jeff Farthing
    Member
    Plugin Author

    Posted 1 year ago #

    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 );

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.