-1

This is the relevant code. Others have faced similar issues on stack overflow but tried a couple of those solutions and didn't seem to work in this case. It seems part of the code needs to be stored in a variable and then that variable stored in $path.

$path = ltrim( end( @explode( get_template(), str_replace( '\\', '/', dirname( __FILE__ ) ) ) ), '/' );

This is occurring on the latest version on Ubuntu.

TechRemarker
  • 2,788
  • 11
  • 37
  • 60

1 Answers1

1

Answer depends of version of PHP you are using, but candidate is END function.

Anyway, this code will work always:

$templatePath = str_replace( '\\', '/', dirname( __FILE__ ) );
$templatePathArray = @explode( get_template(), $templatePath );
$lastDir = end($templatePathArray);
$path = ltrim( $lastDir, '/' );

PS. Are you sure you are using right separator in explode?

michail_w
  • 4,318
  • 4
  • 26
  • 43