最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

php - wordpress notice

programmeradmin2浏览0评论

Notice: Only variables should be passed by reference in /home/bv5u96fbxm8x/public_html/wp-content/themes/123garden/option-tree/ot-loader.php on line 98

kindly provide me solution for this thanks!

$path = ltrim( end( @explode( get_template(), str_replace( '\\', '/', dirname( __FILE__ ) ) ) ), '/' );
define( 'OT_LANG_DIR', trailingslashit( trailingslashit( get_template_directory() ) . $path ) . trailingslashit( 'languages' ) . 'theme-mode' );  
}

Notice: Only variables should be passed by reference in /home/bv5u96fbxm8x/public_html/wp-content/themes/123garden/option-tree/ot-loader.php on line 98

kindly provide me solution for this thanks!

$path = ltrim( end( @explode( get_template(), str_replace( '\\', '/', dirname( __FILE__ ) ) ) ), '/' );
define( 'OT_LANG_DIR', trailingslashit( trailingslashit( get_template_directory() ) . $path ) . trailingslashit( 'languages' ) . 'theme-mode' );  
}
Share Improve this question edited Mar 17, 2020 at 11:18 Tanmay Patel 8111 gold badge7 silver badges11 bronze badges asked Mar 17, 2020 at 10:34 Faisal ShafiqFaisal Shafiq 12 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 0

I'd guess the problem is the end(), which accepts an array reference. Try saving the explode() result in a variable and passing that to end():

$path_components = @explode( get_template(), str_replace( '\\', '/', dirname( __FILE__ ) ) );
$path = ltrim( end( $path_components ), '/' );
define( 'OT_LANG_DIR', trailingslashit( trailingslashit( get_template_directory() ) . $path ) .
                       trailingslashit( 'languages' ) . 'theme-mode' );

Or there are plenty of other ways to get the last element of an array you could use instead of end().

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论