Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Tim W

    (@timwhitlock)

    add_filter( 'latest_tweets_render_list', function( array $items, $screen_name ){
       // process $items array
        return '<div>....your html</div>';
    }, 10 , 1 );
    Thread Starter matt_teamworks

    (@matt_teamworks)

    Thanks, in my case something as simple as the below works:

    add_filter( 'latest_tweets_render_list', function( array $items, $screen_name ){
    	// process $items array
    	foreach ($items as $item) {
    		$out .= $item;
    	}
        return $out;
    }, 10 , 1 );

    However I am also getting an error:

    Warning: Missing argument 2 for {closure}()

    Plugin Author Tim W

    (@timwhitlock)

    The $screen_name argument should always be passed, but perhaps if it is null it doesn’t for some reason.

    You can see the filter being called here:
    https://github.com/timwhitlock/wp-twitter-widget/blob/master/latest-tweets.php#L275

    Try removing the $screen_name argument if you’re not using it. Or just put $screen_name = null in your argument list.

    Thread Starter matt_teamworks

    (@matt_teamworks)

    I am using screen_name, it’s set in the widget.

    However if I echo it from within the filter it’s empty…

    But you are right removing the argument all together or setting $screen_name = null in the argument list works.

    I no longer get a warning yet the tweets are still being returned for the correct account.

    Thanks for your help.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Override the unordered list for tweets’ is closed to new replies.