Upload files to specific post category

Hi,
We're creating an Intranet, where there are management-level specific post categories (managers can only access management category, HR staff only HR category, etc).

Most of the permission access issues are fixed with M2, however, we need to upload files (office documents) to these categories.
- Do you know any plugin/way that allows the user to upload files and select a certain post category to them? So these Office documents are listed as items in the different categories?

Thanks!

  • Rupok
    • Support Ninja

    Hi M.,

    Thanks for the clarification. But I think, I'm confused at a point. Can you help me in understanding this?

    By default, WordPress supports 7 post types:

    Post (Post Type: 'post')
        Page (Post Type: 'page')
        Attachment (Post Type: 'attachment')
        Revision (Post Type: 'revision')
        Navigation Menu (Post Type: 'nav_menu_item')
        Custom CSS (Post Type: 'custom_css')
        Changesets (Post Type: 'customize_changeset')

    And built-in taxonomies like "categories" are post type specific. So built-in "post" taxonomies (e.g. 'post' categories) won't usually work for "attachment" post type. To be more clear, "attachment" is a special post that holds information about a file uploaded through the WordPress media upload system. On the other hand, "Post" in WordPress is a post type that is typical for and most used by blogs [Source: https://codex.wordpress.org/Post_Types.

    So generally the taxonomy "category" which is registered for "post" type, won't work for "attachment" type. As a result, assigning & displaying media files in post categories is normally not possible unless I got your requirement wrong.

    If I understood it right, then there is a way you can register a custom taxonomy for multiple post type by passing an array of multiple post types for $object_type parameter in register_taxonomy function. But that will create custom taxonomy and won't extend your native built-in post categories taxonomy.

    What do you think about this? To be honest, I still think, this might be possible but this will require huge amount of advanced custom coding and hacking. If this was something which can be done in 5 - 10 minutes, I'd love to do that for you. But I think, this will take much more. So I'll suggest you to hire a developer for doing this.

    Please let us know what you think about this. If you have any confusion or any further query, we will be glad to help.

    Note: You can always hire a developer from our Jobs Section for custom jobs like this. Please keep in mind, developers found in our Jobs Section are not associated with us in any way. So communicate with them well before you make any payments to them.

    Have a nice day. Cheers!
    Rupok

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.