Home › Forums › Calendar Products › Community Events › How to hide the administrator name as organizer in the event creation form
- This topic has 15 replies, 2 voices, and was last updated 9 years, 1 month ago by Matthew.
-
AuthorPosts
-
March 27, 2015 at 6:12 am #951413LucianeParticipant
Hello!
I’m using the Community Events and it has been very helpful!
I would like to allow my users to create events but I have 2 doubts about it:1) I don’t want my name organizer to be visible to the others users because they could use my name when creating their own events. And my name appears in the organizer list at the event creation form. Can I hide my name organizer at the list? (My organizer name is “trilheiros.net” and here is the event creation form: http://trilheiros.net/calendario/comunidade/add)
2) I allowed all users to create and publish automatically their events. But after the events creation the users need a login and a password to edit and visualize their events? Only I could register these logins informations or the users can create by their own?
Thanks!
March 27, 2015 at 8:46 am #951513MatthewMemberHello Luciane – excellent questions!
I’m glad to hear you like the Community Events plugin! I like that one too 🙂 Since both of your questions are good ones, I don’t want one of them to get lost in the mix. Would it be possible to ask you second one in a separate post so that it can get the attention that it deserves as we work through the first question?
I can see why exposing your Organizer name to end users may be undesirable. The drop down box that shows your organizer name (trilheiros.net) will grow over time to include other event organizer names. If you want to keep things simple and hide that box completely, there is a really handy filter called tribe_organizer_table_top that you can use to prevent the field (and the label) from displaying. Simply add the following to your functions.php file:
if ( ! is_admin() ) { remove_filter( 'tribe_organizer_table_top', array( Tribe__Events__Events::instance(), 'displayEventOrganizerDropdown' ) ); }//end if
That should hide the “Use Saved Organizer” box and users will be able to enter their own Organizer name in the field provided. Is that approach to the problem one that will work for you?
March 27, 2015 at 1:40 pm #951585LucianeParticipantHi Matthew!
Thank you for the answer!
I’m sorry but I really don’t understand about the construction of sites… Where exactly should I add this filter at my functions.php file?!About the second question, there is no problem. I’ll create another one! 😉
Best regards
March 27, 2015 at 2:29 pm #951594MatthewMemberNot a problem! There should be a functions.php file within your theme (check out the WordPress documentation for more info on finding it and what it does). You should be able to place the code that I posted earlier in one of two ways:
- If functions.php has “?>” at the bottom of the file, place the code directly above that!
- If functions.php does not have “?>” at the bottom of the file, place the code at the very bottom.
I look forward to hearing how it works out! 🙂
April 1, 2015 at 5:47 am #952491LucianeParticipantHi Matthew!
I’ve tried do copy the code and I don’t know why I did because my site doesn’t open anymore and it shows this error: Parse error: syntax error, unexpected T_ENDIF in /home/trilh356/public_html/wp-content/themes/smartline-lite/functions.php on line 299
Please help me out!!! How can I correct this and have my site back?
Here is the end of the code:
get_comment_date(), get_comment_time()) ?>
<?php edit_comment_link(__(‘(Edit)’, ‘smartline-lite’),’ ‘,”) ?>
</div><div class=”comment-content”><?php comment_text(); ?></div>
<div class=”reply”>
<?php comment_reply_link(array_merge( $args, array(‘depth’ => $depth, ‘max_depth’ => $args[‘max_depth’]))) ?>
</div></div>
<?php
endif;/*==================================== INCLUDE FILES ====================================*/
// include Theme Info page
require( get_template_directory() . ‘/inc/theme-info.php’ );// include Theme Customizer Options
require( get_template_directory() . ‘/inc/customizer/customizer.php’ );
require( get_template_directory() . ‘/inc/customizer/default-options.php’ );// include Customization Files
require( get_template_directory() . ‘/inc/customizer/frontend/custom-layout.php’ );
require( get_template_directory() . ‘/inc/customizer/frontend/custom-slider.php’ );// include Template Functions
require( get_template_directory() . ‘/inc/template-tags.php’ );// include Widget Files
require( get_template_directory() . ‘/inc/widgets/widget-category-posts-boxed.php’ );
require( get_template_directory() . ‘/inc/widgets/widget-category-posts-columns.php’ );
require( get_template_directory() . ‘/inc/widgets/widget-category-posts-grid.php’ );
require( get_template_directory() . ‘/inc/widgets/widget-category-posts-single.php’ );// Include Featured Content class in case it does not exist yet (e.g. user has not Jetpack installed)
if ( ! class_exists( ‘Featured_Content’ ) && ‘plugins.php’ !== $GLOBALS[‘pagenow’] ) {
require( get_template_directory() . ‘/inc/featured-content.php’ );
}?>
April 1, 2015 at 6:53 am #952509MatthewMemberOh yikes! I’ve downloaded the same theme you are using: smartline-lite so that I can see what the full file looks like. I think I would need to see more of the file to know what the problem is. Just so I can take a quick peek and maybe get you back up and running quicker, can you copy/paste the whole file into https://gist.github.com/ and share the link with me? (NOTE: if there’s any private data that you’ve placed in the file, remove that before posting).
Hopefully we’ll get you up and running soon!
April 2, 2015 at 5:50 am #952741LucianeParticipantHi Matthew!
I managed to correct the error, but now appears an error in the text that you have send me:
Fatal error: Class ‘Tribe_Events_Events’ not found in /home/trilh356/public_html/wp-content/themes/smartline-lite/functions.php on line 337And when when I delete this text, my site works. Do you have any idea how I can fix it?
Here is the text:
if ( ! is_admin() ) {
remove_filter( ‘tribe_organizer_table_top’, array( Tribe__Events__Events::instance(), ‘displayEventOrganizerDropdown’ ) );
}//end ifThank you!
April 2, 2015 at 6:34 am #952748MatthewMemberI’m very glad you worked through that error! When I copy/paste that into my theme it works fine, however, every installation is a bit different. Here’s a snippet of code that avoids errors a bit better:
function my_organizer_dropdown_remover() { if ( is_admin() ) { return; } if ( ! class_exists( 'Tribe__Events__Events' ) ) { return; } remove_filter( 'tribe_organizer_table_top', array( Tribe__Events__Events::instance(), 'displayEventOrganizerDropdown' ) ); } add_action( 'init', 'my_organizer_dropdown_remover' );
Hopefully that will send you in a better direction! 🙂
April 6, 2015 at 7:57 am #953458LucianeParticipantHi Matthew!
I added the text but my organizer name (Trilheiros.net) still appears at the list of Use Saved Organizers…
I already created this user as administrator in my wordpress panel but nothing changed.Here is the page to create a new event and my name at the list: http://trilheiros.net/calendario/comunidade/add
Thanks!
April 6, 2015 at 6:08 pm #953598MatthewMemberHowdy! Sorry that snippet is still causing some difficulties! When applying that snippet to my Twentyfifteen theme (a default theme for WordPress), the Use Saved Organizers box does not appear on the page:
It appears that there may be something custom on your site that doesn’t play well with that snippet. You could attempt to change the add_action call in that snippet from ‘init’ to ‘wp’ to see if you get better results.
//change:
add_action( 'init', 'my_organizer_dropdown_remover' );//to:
add_action( 'wp', 'my_organizer_dropdown_remover' );
Hopefully that will get you where you need to go! If you find that you need more modifications that you don’t feel comfortable exploring the code yourself and do not know someone whom you can hire, have no fear! We actually keep a list of freelancers who are quite capable of making changes on your behalf. You can obtain this list by emailing [email protected] and requesting it.
That being said, I’m hopeful that the switch to the add_action call will help 🙂 Let me know either way!
April 7, 2015 at 8:13 am #953726LucianeParticipantUnfortunately it didn’t work… the Use Saved Organizers box still appears on my page 🙁
If you have any other idea please send me that I’ll try again. I won’t give up! 🙂Thanks
April 7, 2015 at 12:29 pm #953803MatthewMemberBummer! Let’s try one last thing! I’ve moved the code snippet into a plugin that you can try activating that will hopefully hide that drop-down box. You can view instructions on downloading and activating it here.
My fingers are crossed as I await the results 🙂
April 7, 2015 at 1:43 pm #953822LucianeParticipantIt didn’t work…. 🙁
I installed the plugin and I tried again but this box is powerful and doesn’t disappears!April 8, 2015 at 8:02 am #954039MatthewMemberI’m so sorry this isn’t working as expected! Your theme must be doing something interesting with the plugin loading process. I’ve updated that plugin that you tried with a last ditch effort that I just thought of. Give it a shot again (re-download it and install it from here)!
If that doesn’t work, I believe I’ve reached the end of what I can research and attempt from here without stepping over into doing customization work for your site. One last attempt! Let me know 🙂
April 8, 2015 at 11:01 am #954123LucianeParticipantHi Matthew,
Unfortunately it also didn’t work… 🙁
Anyway I appreciated your attention and thank you for your help!
If you ever have another idea, please do not forget to tell me! I’ll keep trying to hide this box ! 🙂Best regards
Luciane -
AuthorPosts
- The topic ‘How to hide the administrator name as organizer in the event creation form’ is closed to new replies.