Closed boonebgorges closed 8 years ago
Events do support this, it can be toggled in the general settings tabd, but you can forceably enable it too since the array passed to register_post_type()
is filtered. On the single event page no effort is made to display the image, it's left to the theme ala single.php
.
Awesome. That means we just have to enable this in our front-end creation interface, and then display it somehow in our templates.
On 04/17/15 15:02, Stephen Harris wrote:
Events do support this, it can be toggled in the general settings tabd, but you can forceably enable it too since the array passed to |register_post_type()| is filtered. On the single event page no effort is made to display the image, it's left to the theme ala |single.php|.
— Reply to this email directly or view it on GitHub https://github.com/cuny-academic-commons/bp-event-organiser/issues/17#issuecomment-94053555.
This should be done in the recent commits.
Note: In the WP admin area, only users with the 'upload_files'
cap can add a featured image. I have stuck to this guideline for now. This means a user who is a subscriber or a contributor cannot add a featured image at the moment.
Should we dynamically give these users the 'upload_files'
cap only when creating or editing an event?
Awesome - thanks, @r-a-y.
Should we dynamically give these users the 'upload_files' cap only when creating or editing an event?
Yeah, if you can easily do this, please do. Prior art: https://github.com/boonebgorges/buddypress-docs/blob/master/includes/attachments.php#L36 https://github.com/boonebgorges/buddypress-docs/blob/master/includes/attachments.php#L597
This should be completed now.
The BP Docs meta cap example helped!
@r-a-y The way this is currently built, users will see all items from the media library in the media modal. Is there a straightforward way to make this not happen? I kludge it in BuddyPress Docs like this https://github.com/boonebgorges/buddypress-docs/blob/master/includes/attachments.php#L394.
I think we probably shouldn't ship it on the Commons as-is - there is the potential for confusion and perhaps privacy problems. If it's not easy to filter media library images, we should probably disable this feature for v1.
@boonebgorges I've added some code to filter attachments according to the logged-in user when selecting a "Featured Image" instead of by the current post as in BP Docs.
I also would have loved to put this in the WP Frontend Admin Screen library, but it's too late to add the filter in the class before WP can see it.
:+1:
Forgot to close this one as well!
It would be cool for events to support a featured image, which could then be displayed in various places (single event view, activity streams, etc). Does event-organiser support this already? If not, maybe it'd make for a good upstream improvement.