{"id":1363964,"date":"2017-10-15T11:55:22","date_gmt":"2017-10-15T18:55:22","guid":{"rendered":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/problem-with-function-tribe_add_start_end_time_to_month_view-2\/"},"modified":"2017-10-15T11:55:22","modified_gmt":"2017-10-15T18:55:22","slug":"problem-with-function-tribe_add_start_end_time_to_month_view-2","status":"closed","type":"topic","link":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/problem-with-function-tribe_add_start_end_time_to_month_view-2\/","title":{"rendered":"Problem with function &quot;tribe_add_start_end_time_to_month_view &quot;"},"content":{"rendered":"<p>Hi Support Team,<\/p>\n<p>Since 2015 I&#8217;ve been using the following code snippet in my themes function.php file. It is to add the start time to the event title in the calendar month view. Up until recently, this has been working just fine.<\/p>\n<p>\/*<br \/>\n * START &#8211; Adds start time to event titles in Month view<br \/>\n*\/<br \/>\n\tfunction tribe_add_start_time_to_event_title ( $post_title ) {<\/p>\n<p>    \/*if ( !tribe_is_event($post_id) ) return $post_title;*\/<br \/>\n    \/\/ Checks if it is the month view, modify this line to apply to more views<br \/>\n    if ( !tribe_is_month() ) return $post_title;<\/p>\n<p>    \/*$event_start_time = tribe_get_start_time( $post_id );*\/<\/p>\n<p>    if ( !empty( $event_start_time ) ) {<br \/>\n        $post_title = $event_start_time . &#8216; &#8211; &#8216; . $post_title;<br \/>\n    }<\/p>\n<p>    return $post_title;<br \/>\n\t}<br \/>\n\tadd_filter( &#8216;the_title&#8217;, &#8216;tribe_add_start_time_to_event_title&#8217;, 100, 2 );<\/p>\n<p>\/*END &#8211; Adds start time to event titles in Month view *\/<\/p>\n<p>Now I find that the time still displays correctly in the month overview, however it seems that on some but not all posts, when a user clicks the title to drill down into the event, they receive the error shown below.  Going by the error it looks as though the code is expecting two variables to be passed into it but is not receiving them.<\/p>\n<p>To keep the website running, I&#8217;ve temporarily removed this section of code but it is really critical that the start time is easily seen in the month overview.<\/p>\n<p>Fatal error: Uncaught ArgumentCountError: Too few arguments to function tribe_add_start_time_to_event_title(), 1 passed in \/home\/sites\/4b\/b\/b559d673c8\/public_html\/wp-includes\/class-wp-hook.php on line 298 and exactly 2 expected in \/home\/sites\/4b\/b\/b559d673c8\/public_html\/wp-content\/themes\/Avada\/functions.php:114 Stack trace: #0 \/home\/sites\/4b\/b\/b559d673c8\/public_html\/wp-includes\/class-wp-hook.php(298): tribe_add_start_time_to_event_title(&#8216;IXION Chapter 2&#8230;&#8217;) #1 \/home\/sites\/4b\/b\/b559d673c8\/public_html\/wp-includes\/plugin.php(203): WP_Hook-&gt;apply_filters(&#8216;IXION Chapter 2&#8230;&#8217;, Array) #2 \/home\/sites\/4b\/b\/b559d673c8\/public_html\/wp-content\/themes\/Avada\/includes\/class-avada-breadcrumbs.php(490): apply_filters(&#8216;the_title&#8217;, &#8216;IXION Chapter 2&#8230;&#8217;) #3 \/home\/sites\/4b\/b\/b559d673c8\/public_html\/wp-content\/themes\/Avada\/includes\/class-avada-breadcrumbs.php(211): Avada_Breadcrumbs-&gt;get_post_ancestors() #4 \/home\/sites\/4b\/b\/b559d673c8\/public_html\/wp-content\/themes\/Avada\/includes\/class-avada-breadcrumbs.php(168): Avada_Breadcrumbs-&gt;prepare_brea in \/home\/sites\/4b\/b\/b559d673c8\/public_html\/wp-content\/themes\/Avada\/functions.php on line 114<\/p>\n<p>Best regards,<br \/>\nAdam.<\/p>\n","protected":false},"template":"","class_list":["post-1363964","topic","type-topic","status-closed","hentry"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v25.2 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Problem with function &quot;tribe_add_start_end_time_to_month_view &quot; -<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/problem-with-function-tribe_add_start_end_time_to_month_view-2\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Problem with function &quot;tribe_add_start_end_time_to_month_view &quot; -\" \/>\n<meta property=\"og:description\" content=\"Hi Support Team, Since 2015 I&#8217;ve been using the following code snippet in my themes function.php file. It is to add the start time to the event title in the calendar month view. Up until recently, this has been working just fine. \/* * START &#8211; Adds start time to event titles in Month view [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/problem-with-function-tribe_add_start_end_time_to_month_view-2\/\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/problem-with-function-tribe_add_start_end_time_to_month_view-2\/\",\"url\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/problem-with-function-tribe_add_start_end_time_to_month_view-2\/\",\"name\":\"Problem with function &quot;tribe_add_start_end_time_to_month_view &quot; -\",\"isPartOf\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/#website\"},\"datePublished\":\"2017-10-15T18:55:22+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/problem-with-function-tribe_add_start_end_time_to_month_view-2\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/problem-with-function-tribe_add_start_end_time_to_month_view-2\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/problem-with-function-tribe_add_start_end_time_to_month_view-2\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/theeventscalendar.com\/support\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Topics\",\"item\":\"https:\/\/theeventscalendar.com\/support\/topics\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Calendar Products\",\"item\":\"https:\/\/theeventscalendar.com\/support\/forums\/forum\/events\/\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"Events Calendar PRO\",\"item\":\"https:\/\/theeventscalendar.com\/support\/forums\/forum\/events\/events-calendar-pro\/\"},{\"@type\":\"ListItem\",\"position\":5,\"name\":\"Problem with function &quot;tribe_add_start_end_time_to_month_view &quot;\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/theeventscalendar.com\/support\/#website\",\"url\":\"https:\/\/theeventscalendar.com\/support\/\",\"name\":\"\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/theeventscalendar.com\/support\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Problem with function &quot;tribe_add_start_end_time_to_month_view &quot; -","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/problem-with-function-tribe_add_start_end_time_to_month_view-2\/","og_locale":"en_US","og_type":"article","og_title":"Problem with function &quot;tribe_add_start_end_time_to_month_view &quot; -","og_description":"Hi Support Team, Since 2015 I&#8217;ve been using the following code snippet in my themes function.php file. It is to add the start time to the event title in the calendar month view. Up until recently, this has been working just fine. \/* * START &#8211; Adds start time to event titles in Month view [&hellip;]","og_url":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/problem-with-function-tribe_add_start_end_time_to_month_view-2\/","twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/problem-with-function-tribe_add_start_end_time_to_month_view-2\/","url":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/problem-with-function-tribe_add_start_end_time_to_month_view-2\/","name":"Problem with function &quot;tribe_add_start_end_time_to_month_view &quot; -","isPartOf":{"@id":"https:\/\/theeventscalendar.com\/support\/#website"},"datePublished":"2017-10-15T18:55:22+00:00","breadcrumb":{"@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/problem-with-function-tribe_add_start_end_time_to_month_view-2\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/theeventscalendar.com\/support\/forums\/topic\/problem-with-function-tribe_add_start_end_time_to_month_view-2\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/problem-with-function-tribe_add_start_end_time_to_month_view-2\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/theeventscalendar.com\/support\/"},{"@type":"ListItem","position":2,"name":"Topics","item":"https:\/\/theeventscalendar.com\/support\/topics\/"},{"@type":"ListItem","position":3,"name":"Calendar Products","item":"https:\/\/theeventscalendar.com\/support\/forums\/forum\/events\/"},{"@type":"ListItem","position":4,"name":"Events Calendar PRO","item":"https:\/\/theeventscalendar.com\/support\/forums\/forum\/events\/events-calendar-pro\/"},{"@type":"ListItem","position":5,"name":"Problem with function &quot;tribe_add_start_end_time_to_month_view &quot;"}]},{"@type":"WebSite","@id":"https:\/\/theeventscalendar.com\/support\/#website","url":"https:\/\/theeventscalendar.com\/support\/","name":"","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/theeventscalendar.com\/support\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"}]}},"_links":{"self":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/topic\/1363964","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":0,"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/topic\/1363964\/revisions"}],"wp:attachment":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/media?parent=1363964"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}