php - Modifying new code to support PHP5.3 -
i'm using roots.io wordpress starter theme. it's coded php 5.5 server i'm posting site on running php 5.3
i need change code supported php on server, don't know how.
function asset_path($filename) { $dist_path = get_template_directory_uri() . dist_dir; $directory = dirname($filename) . '/'; $file = basename($filename); static $manifest; if (empty($manifest)) { $manifest_path = get_template_directory() . dist_dir . 'assets.json'; $manifest = new jsonmanifest($manifest_path); } if (wp_env !== 'development' && array_key_exists($file, $manifest->get())) { return $dist_path . $directory . $manifest->get()[$file]; } else { return $dist_path . $directory . $file; } }
the issue in line:
return $dist_path . $directory . $manifest->get()[$file];
the [$file]
confusing php think no idea how modify this. tips? if more code needed please let me know.
you'll need split return requesting index method call think started getting supported in 5.4.
try splitting out.
$val = $manifest->get(); return $dist_path . $directory . $val[$file];
for reference know array dereferencing. can find more information here.
Comments
Post a Comment