Home › Forums › Calendar Products › Events Calendar PRO › Hiding fields in The Events Calendar editor metabox?
- This topic has 3 replies, 3 voices, and was last updated 12 years ago by
Leah.
-
AuthorPosts
-
April 7, 2014 at 11:45 am #129048
Gary Poor
ParticipantHello,
Our new / forthcoming website will be launching next week with a calendar powered by Events Calendar Pro. As we’ll be distributing WordPress maintenance across multiple staff members, I want to make that editing process as easy as possible for each of them and not overload them with editor options.
Specifically, while I definitely appreciate all that has gone into your development of Events Calendar Pro, our organization’s events simply don’t require most of the fields that appear in the ECP metabox in the editor. Please take a look at http://mwright.wpengine.com/wp-content/uploads/ecp_metabox_desired.jpg — as you can see in this JPEG, I’d like to hide certain fields in the metabox so that our editors / webmasters don’t even have to consider or be confused by the fields that don’t apply to them.
Is there any way (official or unofficial) to hide these ECP metabox fields from our users, perhaps using remove_meta_box inside functions.php?
Thank you!
April 7, 2014 at 4:02 pm #129246Barry
Member<p>Definitely possible. If I’m interpreting your screenshot correctly and you want to keep some elements from the existing meta box but not all, it may be best to basically recreate the meta box template (the original view file lives at the-events-calendar/admin-views/events-meta-box.php) and strip out what you don’t need.</p><p>You can then tell The Events Calendar to use your version by passing the full filepath to your custom template via the tribe_events_meta_box_template filter hook.</p><p>There are a few other ways you could tackle it, too, like a little Javascript magic if you’re comfortable with that sort of approach – but that’s arguably less ideal and I don’t think there are sufficient CSS classes/IDs to manage this with CSS alone, either, though it’s possible.</p><p>Does that help?</p>
April 8, 2014 at 11:21 am #129602Gary Poor
ParticipantHi Barry,
Thanks so much for your quick reply yesterday! That definitely set me on the right path, and the problem is now solved.
Just as an FYI, unfortunately, the tribe_events_meta_box_template filter approach didn’t work for me. I tried a variety of different methods, including this pastebin code that I ended up finding in another support thread you had helped someone else with (http://pastebin.com/dX6N2XDi), but I just couldn’t figure it out for some reason.
My solution ultimately was to use add_action(‘admin_head’) in my functions.php file to enqueue a CSS stylesheet specifically set to appear on the admin/editor screen. Within that stylesheet, I simply used display:none and visibility:hidden to hide IDs and classes in the Tribe Events metabox.
I think your plugin is absolutely wonderful, as is your customer support! My only constructive suggestion for a future version of The Events Calendar would be to add a display / hide set of options to the settings panel so that a user can hide and show metabox fields like this more easily without having to do any PHP or CSS tricks.
Thanks again! I really appreciate it.
April 11, 2014 at 3:59 pm #131587Leah
MemberI’m glad you got things working mwrightartcenter! If you’d like, you can submit a feature request on our UserVoice page at tribe.uservoice.com/forums/195723-feature-ideas. Thanks!
~Leah
-
AuthorPosts
- The topic ‘Hiding fields in The Events Calendar editor metabox?’ is closed to new replies.
