Support » Plugin: Custom Upload Dir » Upload from the Media Panel and not from Post

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author ulfben

    (@ulfben)

    Yes. Author is post-specific, so obviously it will only work when you’re uploading to a post.

    But author ( and editor ) can also have access to the media panel…
    So I think it is correct to make it works on the media panel also… because, if not, we have to comunicate to them not to upload and use the media panel.
    This my 2 cents…. anyway thank for the work you’ve done.

    Plugin Author ulfben

    (@ulfben)

    That is a valid point. I’ll look into it and see if there’s a way to get the right info in the context of the media library too.

    Right now to solve the problem i use this:

    add_filter('upload_dir', 'my_author_dir');
    function my_author_dir( $param ){
    
        global $current_user;
        $mydir = '/' . $current_user->user_login;
    
        $param['path'] = $param['path'] . $mydir;
        $param['url'] = $param['url'] . $mydir;
    
        error_log("path={$param['path']}");
        error_log("url={$param['url']}");
        error_log("subdir={$param['subdir']}");
        error_log("basedir={$param['basedir']}");
        error_log("baseurl={$param['baseurl']}");
        error_log("error={$param['error']}"); 
    
        return $param;
    }

    thanks!

    I know your plugin is based upon the post filter however I am looking for an application for a shop. The products images need to be in different folder to segregate them. Example:

    Paintings (parent)
    – oil paintings
    – watercolors
    – acrylic

    Is there a plugin to solve this for images?

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Upload from the Media Panel and not from Post’ is closed to new replies.