{"id":1896569,"date":"2019-10-18T13:19:29","date_gmt":"2019-10-18T17:19:29","guid":{"rendered":"https:\/\/theeventscalendar.com\/knowledgebase\/auto-publish-events-submitted-by-logged-in-users-2\/"},"modified":"2026-04-23T18:46:18","modified_gmt":"2026-04-23T22:46:18","slug":"customize-event-submissions","status":"publish","type":"post","link":"https:\/\/theeventscalendar.com\/knowledgebase\/customize-event-submissions\/","title":{"rendered":"Customizing Community Events Submissions"},"content":{"rendered":"\n<p>The Community Events submission form gives your users a way to add events to your calendar, but its default setup won&#8217;t suit every site. This article covers how to adjust what the form asks for and how it behaves \u2014 from changing which fields appear to shaping the submission experience around your own workflow.<\/p>\n\n\n\n<p><strong>See also:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/theeventscalendar.com\/knowledgebase\/customize-event-submission-form\/\">Customizing the Community Event Submission Form<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/theeventscalendar.com\/knowledgebase\/customize-community-pages\/\">Customizing Community Events Pages<\/a><\/li>\n<\/ul>\n\n\n\n<p>Customizations for The Events Calendar are usually implemented via code snippets or template overrides. Add snippets to your child theme&#8217;s <code>functions.php<\/code> file or use the Code Snippets plugin. Template overrides should go in a child theme. If either approach is new to you, start with <a href=\"https:\/\/theeventscalendar.com\/knowledgebase\/best-practices-for-implementing-custom-code-snippets\/\">Using Code Snippets to Customize The Events Calendar<\/a> and <a href=\"https:\/\/theeventscalendar.com\/knowledgebase\/customizing-template-files\/\">Customizing The Events Calendar Templates<\/a> for a walkthrough of each.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-adding-a-submit-event-button\">Adding a Submit Event Button<\/h2>\n\n\n\n<p>If you want visitors to easily find the Community Events submission form from your main calendar page, you can add a button or link using the built-in settings \u2014 no code required.<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>In your WordPress Dashboard, navigate to <strong>Events \u2192 Settings \u2192 Display \u2192 Additional Content Settings<\/strong>.<\/li>\n\n\n\n<li>In the <strong>Add HTML before calendar<\/strong> field, insert the following HTML:<\/li>\n<\/ol>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;div class=\"eventSubmitButton\"&gt;\n    &lt;a href=\"https:\/\/yourwebsite.com\/events\/community\/add\/\" class=\"tribe-common-c-btn\"&gt;Submit Event&lt;\/a&gt;\n&lt;\/div&gt;<\/code><\/pre>\n\n\n\n<ol start=\"3\" class=\"wp-block-list\">\n<li>Replace <code>https:\/\/yourwebsite.com\/events\/community\/add\/<\/code> with the actual URL of your Community Events submission form.<\/li>\n\n\n\n<li>Scroll down and click <strong>Save Changes<\/strong>.<\/li>\n<\/ol>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/images.theeventscalendar.com\/kb\/uploads\/2025\/07\/image-2-edited-scaled.png\" alt=\"Submit Event button shown above the main calendar view\"\/><\/figure>\n\n\n\n<p>This displays a &#8220;Submit Event&#8221; button above your main calendar view. You can style the button further with custom CSS if needed. Community Events must be installed and active for the destination link to work.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-auto-categorizing-submissions\">Auto-Categorizing Submissions<\/h2>\n\n\n\n<p>You may want to automatically assign a specific category \u2014 say, &#8220;Community Event&#8221; \u2014 to every event submitted through the form, without letting users choose it themselves. By default, the plugin doesn&#8217;t have a setting for this, but a small filter handles it cleanly.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;?php\n\nadd_filter( 'tec_events_community_alter_submission_mapping', function( $submission ) {\n    \/\/ IDs of categories you want to always add\n    $required_category_ids = &#91; 4 ];\n\n    $existing = &#91;];\n    if ( isset( $submission&#91;'tax_input']&#91;'tribe_events_cat'] ) ) {\n        $existing = (array) $submission&#91;'tax_input']&#91;'tribe_events_cat'];\n    }\n\n    $merged = array_values( array_unique( array_map( 'intval', array_merge( $existing, $required_category_ids ) ) ) );\n\n    $submission&#91;'tax_input']&#91;'tribe_events_cat'] = $merged;\n\n    return $submission;\n} );<\/code><\/pre>\n\n\n\n<p>Replace the <code>4<\/code> with the <strong>ID of your desired category<\/strong>. You can find the category ID by hovering over or editing the category in your WordPress dashboard \u2014 the ID appears in the URL.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/images.theeventscalendar.com\/kb\/uploads\/2025\/09\/image.png\" alt=\"Finding a category ID in the WordPress dashboard\"\/><\/figure>\n\n\n\n<p>You may also want to <a href=\"https:\/\/theeventscalendar.com\/knowledgebase\/how-to-exclude-certain-categories-from-being-displayed-in-community-events-submission\/\">hide certain categories from the submission form<\/a> so users can&#8217;t pick them.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-auto-publishing-for-logged-in-users\">Auto-Publishing for Logged-In Users<\/h2>\n\n\n\n<p>Under <strong>Events \u2192 Settings \u2192 Community<\/strong>, you can set a default status for submitted events (Draft, Pending Review, or Published). But sometimes you want more nuance \u2014 for instance, auto-publishing events from trusted logged-in users while still holding anonymous submissions for review.<\/p>\n\n\n\n<p>This snippet auto-publishes any event submitted by a registered, logged-in user. Anything submitted by an anonymous user falls back to whatever your default status is set to.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;?php\n\/**\n * Community Events (CE): If user is logged in, set post status to Published, else fallback to CE settings' default.\n *\n * Irrelevant if default post status in CE settings is Published or Anonymous Submissions are not allowed.\n *\/\nfunction set_community_events_publication_status( $option, $default, $optionName ) {\n    if (\n        ! class_exists( 'Tribe__Events__Community__Main' )\n        || 'defaultStatus' !== $optionName\n        || ! is_user_logged_in()\n    ) {\n        return $option;\n    }\n\n    return 'publish';\n}\n\nadd_filter( 'tribe_get_single_option', 'set_community_events_publication_status', 10, 3 );<\/code><\/pre>\n\n\n\n<p>This snippet has no effect if your default post status is already Published, or if anonymous submissions are disabled.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-redirecting-after-submission\">Redirecting After Submission<\/h2>\n\n\n\n<p>After a user submits an event, they&#8217;re taken to a default success page. You may want to redirect them somewhere more specific instead \u2014 a thank-you page, a pending-review explanation, or your calendar&#8217;s main view.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: php; title: ; notranslate\" title=\"\">\n&lt;?php \/\/Do not copy this line\n\nadd_action( &#039;tribe_community_event_save_updated&#039;, function ( $event_id ) {\n\tif ( tribe_is_event( $event_id ) ) {\n\t\t$url = home_url( &#039;\/sample-page\/&#039; );\n\n\t\t\/\/ JS redirect allows server processing to complete\n\t\techo &#039;&lt;script&gt;window.location.href = &quot;&#039; . esc_url( $url ) . &#039;&quot;;&lt;\/script&gt;&#039;;\n\t}\n} );\n<\/pre><\/div>\n\n\n<p>In the snippet, replace <code>\/sample-page\/<\/code> with the URL of the page you want users to be redirected to after submission.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"h-for-developers\">For Developers<\/h4>\n\n\n\n<p>Functions and references used by this customization:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>tribe_community_event_save_updated<\/code> \u2014 the action that fires after a Community Events submission is saved<\/li>\n\n\n\n<li><a href=\"https:\/\/docs.theeventscalendar.com\/reference\/functions\/tribe_is_event\/\"><code>tribe_is_event()<\/code><\/a> \u2014 check whether a given post is an event<\/li>\n\n\n\n<li><a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/API\/Location\/href\"><code>window.location.href<\/code><\/a> \u2014 JavaScript location API, for client-side redirects<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-notifying-submitters-on-publish\">Notifying Submitters on Publish<\/h2>\n\n\n\n<p>By default, submitted events are saved as drafts until an administrator publishes them \u2014 but the original submitter isn&#8217;t notified when that happens. This snippet sends the submitter an email once their event goes live.<\/p>\n\n\n\n<p>Unlike the other snippets in this article, the original guidance for this one is to install it as a tiny single-file plugin rather than dropping it into <code>functions.php<\/code>. Either approach works \u2014 you can also use the Code Snippets plugin if you prefer. If you want to follow the file-based approach, create a new PHP file called <code>events-community-notify-submitter.php<\/code> in your <code>wp-content\/plugins\/<\/code> directory and paste the snippet in:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;?php\n\/*\nPlugin Name: Tribe Snippet: Send email notification when the event is approved\nRequires PHP: 5.6\nVersion: 0.1\n *\/\n\nadd_action( 'transition_post_status', function ( $new_status, $old_status, $post ) {\n    \/\/ Early bail: We are looking for published posts only\n    if ( $new_status != 'publish' ) {\n        return;\n    }\n\n    \/\/ Early bail: Unexpected value\n    if ( ! $post instanceof WP_Post ) {\n        return;\n    }\n\n    \/\/ Early bail: We need the \"tribe\" function to be loaded\n    if ( ! function_exists( 'tribe' ) ) {\n        return;\n    }\n\n    $main = tribe( 'community.main' );\n\n    \/\/ Early bail: We could not get the desired class from the Container\n    if ( ! $main instanceof Tribe__Events__Community__Main ) {\n        return;\n    }\n\n    $default_status = $main-&gt;getOption( 'defaultStatus' );\n\n    \/\/ Early bail: Old status is not the default status\n    if ( $old_status != $default_status ) {\n        return;\n    }\n\n    \/\/ Early bail: We are just interested in Events\n    if ( $post-&gt;post_type != 'tribe_events' ) {\n        return;\n    }\n\n    $author = get_user_by( 'id', $post-&gt;post_author );\n\n    \/\/ Early bail: Author not available (eg: Anonymous submission)\n    if ( ! $author instanceof WP_User ) {\n        return;\n    }\n\n    $email = $author-&gt;user_email;\n\n    \/\/ Early bail: Invalid email\n    if ( ! filter_var( $email, FILTER_VALIDATE_EMAIL ) ) {\n        return;\n    }\n\n    $subject = sprintf( 'Congratulations! %s was published!', $post-&gt;post_title );\n    $message = sprintf( 'Congratulations, your event was published! Click &lt;a href=\"%s\"&gt;here&lt;\/a&gt; to view it!', esc_url( get_post_permalink( $post ) ) );\n\n    wp_mail(\n        $email,\n        esc_html__( $subject, 'tribe-events-community' ),\n        __( wp_kses_post_deep( $message ), 'tribe-events-community' ),\n        &#91; 'Content-Type: text\/html; charset=UTF-8' ]\n    );\n\n}, 10, 3 );<\/code><\/pre>\n\n\n\n<p>If you used the file-based approach, activate the plugin from the WordPress dashboard \u2014 it appears in the plugin list as &#8220;Tribe Snippet: Send email notification when the event is approved.&#8221;<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"h-frequently-asked-questions\">Frequently Asked Questions<\/h4>\n\n\n\n<p><strong>How do I customize the subject of the email?<\/strong><br>Edit the <code>$subject<\/code> line of the snippet.<\/p>\n\n\n\n<p><strong>How do I customize the body of the email?<\/strong><br>Edit the <code>$message<\/code> line of the snippet.<\/p>\n\n\n\n<p><strong>Does it send notifications for anonymous submissions?<\/strong><br>No. If you have &#8220;Allow anonymous submissions&#8221; enabled (<strong>Events \u2192 Settings \u2192 Community<\/strong>) and a user submits an event without being logged in, the snippet can&#8217;t identify an email address for that user and will not send a notification.<\/p>\n\n\n\n<p><strong>Does it send a notification if events are set to be published without review?<\/strong><br>No. If the &#8220;Default status for submitted events&#8221; (<strong>Events \u2192 Settings \u2192 Community<\/strong>) is set to &#8220;Published&#8221;, this snippet will not send any emails.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The Community Events submission form gives your users a way to add events to your calendar, but its default setup won&#8217;t suit every site. This article covers how to adjust what the form asks for and how it behaves \u2014 from changing which fields appear to shaping the submission experience around your own workflow. See&#8230;<\/p>\n","protected":false},"author":84,"featured_media":1955565,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_kad_blocks_custom_css":"","_kad_blocks_head_custom_js":"","_kad_blocks_body_custom_js":"","_kad_blocks_footer_custom_js":"","_swpsp_post_exclude":false,"_kad_post_transparent":"","_kad_post_title":"","_kad_post_layout":"","_kad_post_sidebar_id":"","_kad_post_content_style":"","_kad_post_vertical_padding":"","_kad_post_feature":"","_kad_post_feature_position":"","_kad_post_header":false,"_kad_post_footer":false,"ep_exclude_from_search":false,"footnotes":""},"categories":[120,24,59],"tags":[],"stellar-product-taxonomy":[152],"class_list":["post-1896569","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-community-events","category-customizing","category-php","stellar-product-taxonomy-community-events"],"acf":[],"taxonomy_info":{"category":[{"value":120,"label":"Community Events"},{"value":24,"label":"Customizing"},{"value":59,"label":"PHP"}],"stellar-product-taxonomy":[{"value":152,"label":"Community"}]},"featured_image_src_large":["https:\/\/images.theeventscalendar.com\/kb\/uploads\/2023\/02\/social-share-1024x538.png",1024,538,true],"author_info":{"display_name":"The Events Calendar Team","author_link":"https:\/\/theeventscalendar.com\/knowledgebase\/author\/the_events_calendar_team\/"},"comment_info":0,"category_info":[{"term_id":120,"name":"Community Events","slug":"community-events","term_group":0,"term_taxonomy_id":120,"taxonomy":"category","description":"","parent":0,"count":12,"filter":"raw","term_order":"0","cat_ID":120,"category_count":12,"category_description":"","cat_name":"Community Events","category_nicename":"community-events","category_parent":0},{"term_id":24,"name":"Customizing","slug":"customizing","term_group":0,"term_taxonomy_id":24,"taxonomy":"category","description":"","parent":0,"count":67,"filter":"raw","term_order":"0","cat_ID":24,"category_count":67,"category_description":"","cat_name":"Customizing","category_nicename":"customizing","category_parent":0},{"term_id":59,"name":"PHP","slug":"php","term_group":0,"term_taxonomy_id":59,"taxonomy":"category","description":"","parent":24,"count":52,"filter":"raw","term_order":"0","cat_ID":59,"category_count":52,"category_description":"","cat_name":"PHP","category_nicename":"php","category_parent":24}],"tag_info":false,"_links":{"self":[{"href":"https:\/\/theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/posts\/1896569","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/users\/84"}],"replies":[{"embeddable":true,"href":"https:\/\/theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/comments?post=1896569"}],"version-history":[{"count":5,"href":"https:\/\/theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/posts\/1896569\/revisions"}],"predecessor-version":[{"id":1970165,"href":"https:\/\/theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/posts\/1896569\/revisions\/1970165"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/media\/1955565"}],"wp:attachment":[{"href":"https:\/\/theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/media?parent=1896569"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/categories?post=1896569"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/tags?post=1896569"},{"taxonomy":"stellar-product-taxonomy","embeddable":true,"href":"https:\/\/theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/stellar-product-taxonomy?post=1896569"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}