Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Featured image support for events #17

Closed
boonebgorges opened this issue Apr 17, 2015 · 9 comments
Closed

Featured image support for events #17

boonebgorges opened this issue Apr 17, 2015 · 9 comments

Comments

@boonebgorges
Copy link
Member

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
Copy link

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
Copy link
Member Author

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
#17 (comment).

r-a-y added a commit that referenced this issue Apr 19, 2015
Size is hardcoded to 'medium' size at the moment.

See #17.
@r-a-y
Copy link
Member

r-a-y commented Apr 19, 2015

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?

r-a-y added a commit that referenced this issue Apr 19, 2015
@boonebgorges
Copy link
Member Author

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 added a commit that referenced this issue Apr 22, 2015
This allows users with restricted roles like 'subscriber' and 'contributor'
to set the featured image for event posts.

See #17.
@r-a-y
Copy link
Member

r-a-y commented Apr 22, 2015

This should be completed now.

The BP Docs meta cap example helped!

@r-a-y r-a-y closed this as completed Apr 22, 2015
@boonebgorges boonebgorges reopened this May 5, 2015
@boonebgorges
Copy link
Member Author

@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
Copy link
Member

r-a-y commented May 5, 2015

@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
Copy link
Member Author

👍

r-a-y added a commit that referenced this issue May 12, 2015
Canonical events usually use the featured image as the post header.  So in
these cases, do not show the featured image again.

See #17.
@r-a-y
Copy link
Member

r-a-y commented Feb 23, 2016

Forgot to close this one as well!

@r-a-y r-a-y closed this as completed Feb 23, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants