cuny-academic-commons / bp-event-organiser

Allows Event Organiser plugin events to be assigned to BuddyPress groups and generates a group calendar page for each group
GNU General Public License v2.0
3 stars 1 forks source link

Featured image support for events #17

Closed boonebgorges closed 8 years ago

boonebgorges commented 9 years ago

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.

stephenharris commented 9 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.

boonebgorges commented 9 years ago

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.

r-a-y commented 9 years ago

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?

boonebgorges commented 9 years ago

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

r-a-y commented 9 years ago

This should be completed now.

The BP Docs meta cap example helped!

boonebgorges commented 9 years ago

@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.

r-a-y commented 9 years ago

@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.

boonebgorges commented 9 years ago

:+1:

r-a-y commented 8 years ago

Forgot to close this one as well!