• I’m stumped on this one. I developed a custom plugin that makes use of a custom admin page. The add_menu_page function has the following added to it to include the icon in the admin panel: plugins_url( '/plugin_name/assets/img/plugin-icon.png'

    Everything works fine in my dev environment, however, uploading the zip file to a live site, it excludes the while img folder and the png icon i have within there.

    Anyone has a solution for this?

Viewing 8 replies - 1 through 8 (of 8 total)
  • Hey
    use something like this

    plugin_dir_url( __FILE__ ).'../images/logo.png',2

    Thread Starter designdepotnl

    (@designdepotnl)

    That’s not at all what i described. The code is correct. It works fine when i check it in the console and all.

    On zip upload: the entire img folder gets excluded and doesn’t arrive on the server. It just skips the img folder and the image within.

    You mean to say that when you upload your plugin from WordPress Dashboard then the img folder gets excluded by itself?

    Thread Starter designdepotnl

    (@designdepotnl)

    Yup, really weird. It’s there in the zip file, i checked mutliple times. Upon uploading, the img folder gets excluded. Even when i move the actual image out of the folder and place it in the top folder, where the plugin file itself resides, the image ( a .png file ) gets excluded.

    Have you try to upload your plugin from FTP.

    Thread Starter designdepotnl

    (@designdepotnl)

    Yes, i’ve tried. That works but it really doesn’t add to the reusability of the plugin. Anyway, it seems that there is some extra security in place i was not aware of which makes it impossible to upload files ( even images ) through WP directly.I’m gonna dig around in there and see if i can find a work around.

    Good Luck ??

    Thread Starter designdepotnl

    (@designdepotnl)

    Thanks!

    Oh and thanks for taking the time to help me out. Appreciated! ??

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Uploading plugin excludes img folder and image’ is closed to new replies.