‘Fold out’ tab not working after PHP 7.4

I’m using a theme on my website that hasn’t been updated for a while and needed some fixing here and there, especially after upgrading to PHP 7.4. Everything works fine now, expect for one thing. I have this tab/button in the right top part of my website which you can click for user login. The normal behaviour is that it folds out once it’s clicked and then there’s a login link. The button doesn’t work anymore and reverting back to PHP 7.0 makes it work again, but I don’t want to go back to that old PHP version.

So now there’s this code snippet which actually makes this thing work. I think some elements of it are not any longer supported by this PHP version but my knowledge is not good enough to be able to see what the problem is and to rewrite it. So I was hoping someone here could help me out with rewriting this code to have it work properly on PHP 7.4.

This is the code that’s being used and that became pretty useless since the PHP 7.4 update. The theme I’m using is DFblog by Daniel Fajardo. Unfortunately it’s impossible to reach him. There’s a website but the e-mail form doesn’t work.

function df_get_usermenu() {

	global $current_user;

	echo( '<div id="usermenu">' );

	echo( '<div class="caption"><ul>' );
	if( is_user_logged_in() ) {
		echo( '<li>'.sprintf(__('Howdy, <a href="%1$s" title="Edit your profile">%2$s</a>', 'dfBlog' ), get_template_directory_uri()."/../../../wp-admin/profile.php", $current_user->user_login ).'</li>' );
	echo( '<li class="last">' );
	echo( '</li></ul></div>' );

	echo( '<div class="clear tab">' );
	echo( '<a href="#" title="'.__( 'Users', 'dfBlog' ).'">' );
	echo( '<img src="'.get_template_directory_uri().'/images/icons/arrow-dn.png" alt="btn" />' );
	echo( '<img src="'.get_template_directory_uri().'/images/icons/arrow-up.png" alt="btn" style="display: none" />' );
	echo( '</a></div>' );

	echo( '</div>' );

	return( true );
  • This topic was modified 9 hours, 30 minutes ago by Jan Dembowski.

The page I need help with: [log in to see the link]

Source link