注意:在/home/bv5u96fbxm8x/public\\u html/wp-content/themes/123garden/option-tree/ot-loader中只能通过引用传递变量。php在线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\' );
}
SO网友:Rup
我想问题是end(), 它接受数组引用。尝试将explode()结果保存在变量中,并将其传递给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\' );
或者有很多
other ways to get the last element of an array 可以使用而不是end()。