• Hi,
    I am trying to move a file using the command below:
    rename(“/wp-content/plugins/dm-custom/$file”, “$my_theme_root/$newfile”);
    but I get the following error “Cannot rename a file across wrapper types”

    I have checked http://php.net/manual/en/function.rename.php which says that “The wrapper used in oldname must match the wrapper used in newname”
    I have tried variables of the oldname ($file) and newname ($newfile) but the same error shows.

    Does anyone have a suggestion on this please? Very grateful for you help.

    FYI Variables in above are shown below
    $my_theme_root = get_stylesheet_directory_uri();
    $file = ‘dm-custom-m.css’;
    $newfile = ‘dm-custom-master.css’;

The topic ‘PHP – Rename command’ is closed to new replies.