• Resolved jamminjames

    (@jamminjames)


    Images uploaded by posters using this plugin who are not logged in display this in the Attachment details in the Media Library: “Uploaded by:?(no author).”

    I’d like to be able to display all images uploaded anonymously in the library. Is this possible using a plugin hook?

    Another thing, since the WP “ajax_query_attachments_args” filter can be used to filter images shown in the library by user ID, it would be nice if we could set an image’s user ID attribute to something for anonymous posters when they submit their post. (It could be a user ID of an account set up just for that purpose, or whatever.)

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

    (@specialk)

    Glad to help:

    1. “Images uploaded by posters using this plugin who are not logged in display this in the Attachment details in the Media Library: ‘Uploaded by:?(no author)’.”

    Thanks for reporting, this looks like a bug for users who are not logged in to WordPress when submitting a post/images. So while logged-in users will have their name displayed next to images in the Media Library, the name is missing for users who are not logged in. I will get this fixed up in the next version of the plugin.

    2. “I’d like to be able to display all images uploaded anonymously in the library. Is this possible using a plugin hook?”

    It’s not a plugin feature, but it may be possible in general if there is a hook for media display, depending on location (i.e., front end or back end).

    3. “Another thing, since the WP “ajax_query_attachments_args” filter can be used to filter images shown in the library by user ID, it would be nice if we could set an image’s user ID attribute to something for anonymous posters when they submit their post.”

    Yes that is how it supposed to work by default. The user name associated with images is determined by the plugin setting, Assigned Author. As explained in #1, there is a bug where no name is displayed if the user is not logged in when submitting a post/images. If you log in and try again with some images, you will find the user name is displayed correctly. Again, I will get this fixed up next plugin update.

    Thanks for your feedback, let me know if I can provide any further information. Glad to help anytime.

    Thread Starter jamminjames

    (@jamminjames)

    Great, thanks!

    Plugin Author Jeff Starr

    (@specialk)

    Hey @jamminjames, just to follow up with this. The next version of USP (20231102) fixes the bug with no user specified for uploaded media. Also adds a filter hook that enables you to specify a custom user ID for any files uploaded by non-logged users. Here is an example of how to use:

    function usp_attachment_author_id($author_id) { return 1; }
    add_filter('usp_attachment_author_id', 'usp_attachment_author_id');

    Change the 1 to any user ID, no other changes necessary. New plugin version should be available later today or tomorrow. Thanks again for your feedback and suggestions, much appreciated.

    Thread Starter jamminjames

    (@jamminjames)

    Sounds great, glad you folks are so responsive to users’ suggestions.

    You said it “fixes the bug with no user specified for uploaded media.” What will the user be specified as, if they are not logged in, and if we don’t use the function?

    Thanks!

    Plugin Author Jeff Starr

    (@specialk)

    “What will the user be specified as, if they are not logged in, and if we don’t use the function?”

    The same as the user that is specified for the submitted post, set by the plugin setting, “Assigned Author”.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Add ‘Uploaded by’ ID and/or filter for anonymously uploaded images’ is closed to new replies.