Support

Account

Forum Replies Created

  • Awesome stuff, thank you. I really appreciate the additional insight.

  • That filter did the trick. Thank you very much, John.

    What are the potential downsides of such a solution? Minor UI loss?

    And while the ACF filter solution is certainly cleaner, I also happened upon this solution, which worked, but seems to be forcing a specific version of select2 to load, presumably site-wide:

    function enqueue_select2_jquery() {
    wp_register_style( 'select2css', '//cdnjs.cloudflare.com/ajax/libs/select2/3.4.8/select2.css', false, '1.0', 'all' );
    wp_register_script( 'select2', '//cdnjs.cloudflare.com/ajax/libs/select2/3.4.8/select2.js', array( 'jquery' ), '1.0', true );
    wp_enqueue_style( 'select2css' );
    wp_enqueue_script( 'select2' );
    }
    add_action( 'admin_enqueue_scripts', 'enqueue_select2_jquery' );
    add_action('admin_head', 'my_admin_ket');
    function my_admin_ket() {
    echo '
    
    <script type="text/javascript"> jQuery(document).ready(function($) { jQuery(".option-tree-ui-select").select2(); }); </script>
    ';
    }
    }

    Any opinion as to whether or not I’d better off going a similar route, if not this latter solution exactly?

    As a side note (mostly), ACF Pro and The Events Calendar are bundled with Avada Theme to some extent, which makes me wonder what’s going on under the hood to help the error be avoided on the custom Tribe Events post type, but not on the native posts/pages type.

  • Alas, I’m afraid we’re at a true impasse (no doubt because of my own inability to lend much further assistance).

    I’ll revive this thread if I come across something useful as my debugging capabilities expand, and in the interim I’ll see if I can find an entirely alternative solution.

    John, I truly cannot thank you enough for all of the time you’ve dedicated to this, as well as the undue patience you’ve demonstrated throughout. The entire WordPress community is fortunate to have you.

  • Sure, so here’s the tribe_organizer_upcoming_events function:

    <?php
    
    /**
    	 * Output the upcoming events associated with a venue
    	 *
    	 * @return void
    	 */
    	function tribe_organizer_upcoming_events( $post_id = false ) {
    
    		$post_id = Tribe__Events__Main::postIdHelper( $post_id );
    
    		if ( $post_id ) {
    
    			$args = array(
    				'organizer'      => $post_id,
    				'eventDisplay'   => 'list',
    				'posts_per_page' => apply_filters( 'tribe_events_single_organizer_posts_per_page', 100 ),
    				'starts_after'   => 'now',
    			);
    
    			$html = tribe_include_view_list( $args );
    
    			return apply_filters( 'tribe_organizer_upcoming_events', $html );
    		}
    	}

    Here (more importantly, I hope) is the support page for using tribe_get_events(), which they go on to describe as “a neat little helper function that makes it easy to retrieve event data when building customizations,” before offering something of a basic-use tutorial, as well as how it relates to the WP_Query class or the get_posts() function:
    https://support.theeventscalendar.com/666307-Using-tribe_get_events

    Not sure whether this could prove helpful in any way, but here is the support page for Tribe Settings API:
    https://support.theeventscalendar.com/489740-Tribe-Settings-API

    An overview of the tribe_get_organizer function parameters:
    https://theeventscalendar.com/function/tribe_get_organizer/

    I’d be happy to additionally provide you with any of the “Pro” plugin files you’d think might be helpful. I’m not sure how appropriate it would be to do so here, but let me know if that’s something worth exploring.

    Finally, this may be so dated that it’s ultimately worthless at this point in time, but here were all of the Events Calendar Custom fields, as provided about three years ago:

    The Events Calendar Custom Fields @3.9
    
    Event Custom Post Type ( tribe_events )
    _EventAllDay
    _EventStartDate
    _EventEndDate
    _EventDuration
    _EventVenueID
    _EventShowMapLink
    _EventShowMap
    _EventCurrencySymbol
    _EventCurrencyPosition
    _EventCost
    _EventCostMin
    _EventCostMax
    _EventURL
    _EventOrganizerID
    _EventPhone
    _EventHideFromUpcoming			
    _FacebookID
    _EventOrigin
    
    Venue Custom Post Type ( tribe_venue )
    _VenueVenue
    _VenueCountry
    _VenueAddress
    _VenueCity
    _VenueStateProvince
    _VenueState
    _VenueProvince
    _VenueZip
    _VenuePhone
    _VenueURL
    
    To get Venue ID for an event use this function:
    
    tribe_get_venue_id( $event_id );
    			
    Organizer Custom Post Type ( tribe_organizer )
    _OrganizerOrganizer
    _OrganizerEmail
    _OrganizerWebsite
    _OrganizerPhone
    
    To get Organizer ID for an event use this function:
    
    tribe_get_organizer_id( $event_id );
    
    Capabilities
    edit_tribe_event
    read_tribe_event
    delete_tribe_event
    delete_tribe_events
    edit_tribe_events
    edit_others_tribe_events
    delete_others_tribe_events
    publish_tribe_events
    edit_published_tribe_events
    delete_published_tribe_events
    delete_private_tribe_events
    edit_private_tribe_events
    read_private_tribe_events
    
    edit_tribe_venue
    read_tribe_venue
    delete_tribe_venue
    delete_tribe_venues
    edit_tribe_venues
    edit_others_tribe_venues
    delete_others_tribe_venues
    publish_tribe_venues
    edit_published_tribe_venues
    delete_published_tribe_venues
    delete_private_tribe_venues
    edit_private_tribe_venues
    read_private_tribe_venues
    
    edit_tribe_organizer
    read_tribe_organizer
    delete_tribe_organizer
    delete_tribe_organizers
    edit_tribe_organizers
    edit_others_tribe_organizers
    delete_others_tribe_organizers
    publish_tribe_organizers
    edit_published_tribe_organizers
    delete_published_tribe_organizers
    delete_private_tribe_organizers
    edit_private_tribe_organizers
    read_private_tribe_organizers
  • On some level, I’m certainly wishing that I went the custom events section route as you tend to do. That said, for all of my programming knowledge deficiencies, I find these troubleshooting efforts incredibly addictive, and they’re the reason I’m shoulder deep in javascript training courses and the like. I truly can’t get enough of it. Anyways —

    Shot in the dark, but maybe the following could help us (in some small way) get to the bottom of this, or blaze the best alternative solution path:

    As I have hopefully made clear, “Organizers” is a native custom post type included with the Tribe plugin. So for the sake of testing and my own understanding, I moved from my functions.php over to the single organizer page template (organizer.php).

    We’ve established (or so I meant to) that the upcoming events related to the given organizer are output with echo tribe_organizer_upcoming_events( $organizer_id );

    So I added the following to the template file:

    <?php
    // tribe_get_organizers_ids() function with the event ID I've been testing on
    $test_organizer_ids = tribe_get_organizer_ids(38901);

    And this below the native echo tribe_organizer_upcoming_events( $organizer_id );:

    <?php
    		echo '<pre>';
    print_r($test_organizer_ids);
    echo '</pre>';

    Which returned the organizer IDs, but—predictably, I’m sure—only the IDs of the Organizers set via the native tribe meta field:

    Array
    (
        [0] => 16671
        [1] => 29406
        [2] => 29415
        [3] => 30056
    )

    There’s a good chance this does nothing to help you/us, but at least I can feel slightly less guilt in knowing that you know that I’m not just sitting on my hands while you provide above-and-beyond support.

    Here’s the full edited template file. Maybe the action filters provide some clue with respect to timing as well?

    <?php
    /**
     * Single Organizer Template
     * The template for an organizer. By default it displays organizer information and lists
     * events that occur with the specified organizer.
     *
     * This view contains the filters required to create an effective single organizer view.
     *
     * You can recreate an ENTIRELY new single organizer view by doing a template override, and placing
     * a Single_Organizer.php file in a tribe-events/pro/ directory within your theme directory, which
     * will override the /views/pro/single_organizer.php.
     *
     * You can use any or all filters included in this file or create your own filters in
     * your functions.php. In order to modify or extend a single filter, please see our
     * readme on templates hooks and filters (TO-DO)
     *
     * @package TribeEventsCalendarPro
     *
     * @version 4.4.28
     */
    
    if ( ! defined( 'ABSPATH' ) ) {
    	die( '-1' );
    }
    
    $organizer_id = get_the_ID();
    $test_organizer_ids = tribe_get_organizer_ids(38901);
    
    ?>
    
    <?php while ( have_posts() ) : the_post(); ?>
    	<div class="tribe-events-organizer">
    			<p class="tribe-events-back">
    				<a href="<?php echo esc_url( tribe_get_events_link() ); ?>" rel="bookmark"><?php printf( __( '&larr; Back to %s', 'tribe-events-calendar-pro' ), tribe_get_event_label_plural() ); ?></a>
    			</p>
    
    		<?php do_action( 'tribe_events_single_organizer_before_organizer' ) ?>
    		<div class="tribe-events-organizer-meta tribe-clearfix">
    
    				<!-- Organizer Title -->
    				<?php do_action( 'tribe_events_single_organizer_before_title' ) ?>
    				<h1 class="tribe-organizer-name"><?php echo tribe_get_organizer( $organizer_id ); ?></h1>
    				<?php do_action( 'tribe_events_single_organizer_after_title' ) ?>
    
    				<!-- Organizer Meta -->
    				<?php do_action( 'tribe_events_single_organizer_before_the_meta' ); ?>
    				<?php echo tribe_get_organizer_details(); ?>
    				<?php do_action( 'tribe_events_single_organizer_after_the_meta' ) ?>
    
    				<!-- Organizer Featured Image -->
    				<?php echo tribe_event_featured_image( null, 'full' ) ?>
    
    				<!-- Organizer Content -->
    				<?php if ( get_the_content() ) { ?>
    				<div class="tribe-organizer-description tribe-events-content">
    					<?php the_content(); ?>
    				</div>
    				<?php } ?>
    
    			</div>
    			<!-- .tribe-events-organizer-meta -->
    		<?php do_action( 'tribe_events_single_organizer_after_organizer' ) ?>
    
    		<!-- Upcoming event list -->
    		<?php do_action( 'tribe_events_single_organizer_before_upcoming_events' ) ?>
    
    		<?php
    		// Use the tribe_events_single_organizer_posts_per_page to filter the number of events to get here.
    		echo tribe_organizer_upcoming_events( $organizer_id );
    		echo '<pre>';
    print_r($test_organizer_ids);
    echo '</pre>';
    		 ?>
    
    		<?php do_action( 'tribe_events_single_organizer_after_upcoming_events' ) ?>
    
    	</div><!-- .tribe-events-organizer -->
    	<?php
    	do_action( 'tribe_events_single_organizer_after_template' );
    endwhile;
  • If there’s one thing I do know, it’s that the last thing you owe me is an apology. Thanks for following up.

    Unfortunately, increasing the priority made no difference.

    Ignoring the apparent changes to the Tribe events plugin for a moment, your last comment on the meta query got me thinking about this WP Sweep plugin I installed and used not too long ago —

    I can’t be certain with respect to the timing, as it never occurred to me to check whether or not an issue in this area manifested, but it feels like it may have been close.

    Is it possible that in “sweeping” the database, I inadvertently purged some metadata that had once been holding the query together? At this point, I have to assume we’re too far removed (and too uncertain on the timing) to make restoring the database a viable option. But, with respect to ACF Pro and your intimate understanding of its inner-workings, is there anything I might be able to do to repair the damage done (or re-establish the data that may have been lost)?

    For what it’s worth, I just finished performing WordPress’ native database repair function on my dev environment, but it didn’t find any issues.

    That aside, a couple of options that I’m considering and wondering whether or not you think it’s time to give them a shot (happy to continue down our current path if that’s your preference/suggestion):

    1. Is there anything specific you’d recommend I ask the Tribe support team? They certainly won’t put forth any meaningful effort toward resolving the overall issue, but hopefully they can provide more specific answers on relevant functionality that I can’t. Is there anything in particular that might be especially illuminating with respect to troubleshooting this?
    2. Should I look into another means of separating speakers and organizers on the front-end of the single event pages, via different ACF field-type?

      For example, maybe something that would allow me to set all “Speakers | Organizers” via the native Tribe meta field selection, then use an ACF field to effectively mark or define which “Speaker | Organizer” should be listed under the “Speaker” header in the front-end meta section. Not sure how feasible this would be before digging in to the myriad of ACF field options.

    3. Should we consider the standalone query option I mentioned previously? That reference pasted below:

      If any easier, would it be possible to help me write a standalone query, for placement within the Tribe single-organizer.php template (pasted below), instead? Like the native tribe_organizer_upcoming_events function, the idea——in theory——would be for it to find any Tribe single event post where the organizer ID was added to the event meta, and return each given event ID.

      In other words, it would look for any Tribe event where the given organizer ID is selected via the ACF Pro field “the_organizers”.

  • Thanks John.

    It’s entirely possible that I’m implementing your recently suggested code in a manner other than what you had in mind, but either way, still no luck. For what it’s worth, my attempted variations have included both 'value' => $query->get('tribe_organizer') and 'value' => $query->get('organizer').

    At this point, personal guilt with respect to your time is starting to creep in. If this has become too complicated, and/or if these efforts have come to require too much hand-holding, I completely understand. Just let me know.

    Regardless of the ultimate outcome, I can’t thank you enough for the time you’ve already dedicated to assisting me.

  • Hi John — I hope you had a nice, relaxing and well-deserved weekend.

    $query->get( ‘organizer’ ) is returning nothing because it is not set. It appears that this has been changed to tribe_organizer.

    You appear to be correct. With the code above in place, the die function is never returned. Once changed to get( 'tribe_organizer' ), “query var set” is returned.

    So I gave this a look:

    if ($query->get('tribe_organizer')) {
      var_dump($query->get('tribe_organizer')); echo '<br />';
    }

    Which returned:
    string(14) "alex-greenbaum"

    So —

    You need the post ID for this organizer and not the name.

    Given what you’ve explained to be what we’re looking for, would either of these solutions, if nothing else, be helpful starting points?

    Solution 1 (based on this native Tribe function tribe_get_organizer_ids)

    // search the ID of organizer
    $organizers = tribe_get_organizer_ids($id);
    
    // retrieve name of organizer
    // will create an events loop tribe_get_events
    $orgName = array();
    foreach($organizers as $organizerId) {
      $orgName[] = tribe_get_organizer($organizerId);
    }

    And, another here: Solution 2

    Additionally, all of the native Tribe organizer-related functions, straight from their documentation here.

    Tell me more about this query we’re trying to modify, it is a sub query? The information for the organizer has already been shown and now you are trying to show the events that they are organizing?

    That is correct. I am trying to display all of the events for which the organizer has been set as an organizer/speaker.

    The “Organizer” page, as it is natively called, is said to be a custom taxonomy.

    Bear with me here, because it may (almost certainly will) get a little confusing. I have changed the label of this post-type (or custom taxonomy?) to “Speakers | Organizers”. With some template customization, and the help of ACF Pro, from the single event edit screen, I use the native meta section to select what is being output under a “Speakers” header in the meta section on the front end, and a separate ACF Pro relational object field to select what is being output under an “Organizers” header in the meta section on the front end. Both the native meta object selection field and the ACF Pro selection field are pulling from the same pool of “Speakers | Organizers.”

    That’s all working as intended.

    By default, the individual Speaker | Organizers pages then display all upcoming events that the Speaker | Organizer is tied to. For a while, that solution I posted in the first post of this thread, ensured that the upcoming event was posted on the individual’s Speaker | Organizer, regardless of whether they were attached via the native tribe meta field or the ACF Pro relational field. Now, however, the upcoming events loop found on the individual Speaker | Organizer page is only pulling in that respective Speaker | Organizer’s upcoming event if it were set via the native meta field (while failing to recognize it as an upcoming event if set via the ACF Pro relational field).

  • I can’t even begin to explain how much I appreciate your help, John. You, personally, are seen everywhere across this forum, going above and beyond to provide support to an extent that I don’t see from any support team at all (and doing so for arguably as valuable a plugin as exists). In all sincerity, thank you. It’s nothing short of amazing.

    Anyways, using the code you’ve provided above, I can confirm that, yes, the filter is in indeed being called.

  • Thanks John,

    I understand, and sincerely appreciate you taking the time to respond at all nonetheless.

    Unfortunately, the Tribe support staff has consistently proven quite eager to avoid providing any assistance said to fall beyond their “Scope of Support.” This was the gist of their response —

    I did look at your PHP file and it looks very similar (other than ACF logic) to what The Events Calendar is already doing: https://github.com/moderntribe/the-events-calendar/blob/4.9.1.1/src/Tribe/Query.php#L455-L461

    I’m not personally very familiar with ACF, but I know their codebase has received significant updates in recent history so maybe their logic isn’t as it used to be.

    If any easier, would it be possible to help me write a standalone query, for placement within the Tribe single-organizer.php template (pasted below), instead? Like the native tribe_organizer_upcoming_events function, the idea——in theory——would be for it to find any Tribe single event post where the organizer ID was added to the event meta, and return each given event ID.

    In other words, it would look for any Tribe event where the given organizer ID is selected via the ACF Pro field “the_organizers”.

    I’ve also included a link to a screenshot for additional reference, plus a few potentially relevant example links, below:

    Screenshot

    Single Event Page

    Speaker | Organizer Page
    (set by native Tribe field–upcoming event display)

    Speaker | Organizer Page
    (set by ACF relational object field–upcoming event not display)

    <?php
    /**
     * Single Organizer Template
     * The template for an organizer. By default it displays organizer information and lists
     * events that occur with the specified organizer.
     *
     * This view contains the filters required to create an effective single organizer view.
     *
     * You can recreate an ENTIRELY new single organizer view by doing a template override, and placing
     * a Single_Organizer.php file in a tribe-events/pro/ directory within your theme directory, which
     * will override the /views/pro/single_organizer.php.
     *
     * You can use any or all filters included in this file or create your own filters in
     * your functions.php. In order to modify or extend a single filter, please see our
     * readme on templates hooks and filters (TO-DO)
     *
     * @package TribeEventsCalendarPro
     *
     * @version 4.4.28
     */
    
    if ( ! defined( 'ABSPATH' ) ) {
    	die( '-1' );
    }
    
    $organizer_id = get_the_ID();
    ?>
    
    <?php while ( have_posts() ) : the_post(); ?>
    	<div class="tribe-events-organizer">
    			<p class="tribe-events-back">
    				<a href="<?php echo esc_url( tribe_get_events_link() ); ?>" rel="bookmark"><?php printf( __( '&larr; Back to %s', 'tribe-events-calendar-pro' ), tribe_get_event_label_plural() ); ?></a>
    			</p>
    
    		<?php do_action( 'tribe_events_single_organizer_before_organizer' ) ?>
    		<div class="tribe-events-organizer-meta tribe-clearfix">
    
    				<!-- Organizer Title -->
    				<?php do_action( 'tribe_events_single_organizer_before_title' ) ?>
    				<h1 class="tribe-organizer-name"><?php echo tribe_get_organizer( $organizer_id ); ?></h1>
    				<?php do_action( 'tribe_events_single_organizer_after_title' ) ?>
    
    				<!-- Organizer Meta -->
    				<?php do_action( 'tribe_events_single_organizer_before_the_meta' ); ?>
    				<?php echo tribe_get_organizer_details(); ?>
    				<?php do_action( 'tribe_events_single_organizer_after_the_meta' ) ?>
    
    				<!-- Organizer Featured Image -->
    				<?php echo tribe_event_featured_image( null, 'full' ) ?>
    
    				<!-- Organizer Content -->
    				<?php if ( get_the_content() ) { ?>
    				<div class="tribe-organizer-description tribe-events-content">
    					<?php the_content(); ?>
    				</div>
    				<?php } ?>
    
    			</div>
    			<!-- .tribe-events-organizer-meta -->
    		<?php do_action( 'tribe_events_single_organizer_after_organizer' ) ?>
    
    		<!-- Upcoming event list -->
    		<?php do_action( 'tribe_events_single_organizer_before_upcoming_events' ) ?>
    
    		<?php
    		// Use the tribe_events_single_organizer_posts_per_page to filter the number of events to get here.
    		echo tribe_organizer_upcoming_events( $organizer_id ); ?>
    
    		<?php do_action( 'tribe_events_single_organizer_after_upcoming_events' ) ?>
    
    	</div><!-- .tribe-events-organizer -->
    	<?php
    	do_action( 'tribe_events_single_organizer_after_template' );
    endwhile;
  • Thanks John,

    I understand, and sincerely appreciate you taking the time to respond at all nonetheless.

    Unfortunately, the Tribe support staff has consistently proven quite eager to avoid providing any assistance said to fall beyond their “Scope of Support.” This was the gist of their response —

    I did look at your PHP file and it looks very similar (other than ACF logic) to what The Events Calendar is already doing: https://github.com/moderntribe/the-events-calendar/blob/4.9.1.1/src/Tribe/Query.php#L455-L461

    I’m not personally very familiar with ACF, but I know their codebase has received significant updates in recent history so maybe their logic isn’t as it used to be.

    If any easier, would it be possible to help me write a standalone query, for placement within the Tribe single-organizer.php template (both attached and pasted below), instead? Like the native tribe_organizer_upcoming_events function, the idea——in theory——would be for it to find any Tribe single event post where the organizer ID was added to the event meta, and return each given event ID.

    In other words, it would look for any Tribe event where the given organizer ID is selected via the ACF Pro field “the_organizers”.

    I’ve also attached a detailed screenshot for additional reference, as well as a few potentially relevant example links:

    Single Event Page

    Speaker | Organizer Page
    (set by native Tribe field–upcoming event display)

    Speaker | Organizer Page
    (set by ACF relational object field–upcoming event not display)

    <?php
    /**
     * Single Organizer Template
     * The template for an organizer. By default it displays organizer information and lists
     * events that occur with the specified organizer.
     *
     * This view contains the filters required to create an effective single organizer view.
     *
     * You can recreate an ENTIRELY new single organizer view by doing a template override, and placing
     * a Single_Organizer.php file in a tribe-events/pro/ directory within your theme directory, which
     * will override the /views/pro/single_organizer.php.
     *
     * You can use any or all filters included in this file or create your own filters in
     * your functions.php. In order to modify or extend a single filter, please see our
     * readme on templates hooks and filters (TO-DO)
     *
     * @package TribeEventsCalendarPro
     *
     * @version 4.4.28
     */
    
    if ( ! defined( 'ABSPATH' ) ) {
    	die( '-1' );
    }
    
    $organizer_id = get_the_ID();
    ?>
    
    <?php while ( have_posts() ) : the_post(); ?>
    	<div class="tribe-events-organizer">
    			<p class="tribe-events-back">
    				<a href="<?php echo esc_url( tribe_get_events_link() ); ?>" rel="bookmark"><?php printf( __( '&larr; Back to %s', 'tribe-events-calendar-pro' ), tribe_get_event_label_plural() ); ?></a>
    			</p>
    
    		<?php do_action( 'tribe_events_single_organizer_before_organizer' ) ?>
    		<div class="tribe-events-organizer-meta tribe-clearfix">
    
    				<!-- Organizer Title -->
    				<?php do_action( 'tribe_events_single_organizer_before_title' ) ?>
    				<h1 class="tribe-organizer-name"><?php echo tribe_get_organizer( $organizer_id ); ?></h1>
    				<?php do_action( 'tribe_events_single_organizer_after_title' ) ?>
    
    				<!-- Organizer Meta -->
    				<?php do_action( 'tribe_events_single_organizer_before_the_meta' ); ?>
    				<?php echo tribe_get_organizer_details(); ?>
    				<?php do_action( 'tribe_events_single_organizer_after_the_meta' ) ?>
    
    				<!-- Organizer Featured Image -->
    				<?php echo tribe_event_featured_image( null, 'full' ) ?>
    
    				<!-- Organizer Content -->
    				<?php if ( get_the_content() ) { ?>
    				<div class="tribe-organizer-description tribe-events-content">
    					<?php the_content(); ?>
    				</div>
    				<?php } ?>
    
    			</div>
    			<!-- .tribe-events-organizer-meta -->
    		<?php do_action( 'tribe_events_single_organizer_after_organizer' ) ?>
    
    		<!-- Upcoming event list -->
    		<?php do_action( 'tribe_events_single_organizer_before_upcoming_events' ) ?>
    
    		<?php
    		// Use the tribe_events_single_organizer_posts_per_page to filter the number of events to get here.
    		echo tribe_organizer_upcoming_events( $organizer_id ); ?>
    
    		<?php do_action( 'tribe_events_single_organizer_after_upcoming_events' ) ?>
    
    	</div><!-- .tribe-events-organizer -->
    	<?php
    	do_action( 'tribe_events_single_organizer_after_template' );
    endwhile;
  • Thanks John,

    I understand, and sincerely appreciate you taking the time to respond at all nonetheless.

    Unfortunately, the Tribe support staff has consistently proven quite eager to avoid providing any assistance said to fall beyond their “Scope of Support.” This was the gist of their response —

    I did look at your PHP file and it looks very similar (other than ACF logic) to what The Events Calendar is already doing: https://github.com/moderntribe/the-events-calendar/blob/4.9.1.1/src/Tribe/Query.php#L455-L461

    I’m not personally very familiar with ACF, but I know their codebase has received significant updates in recent history so maybe their logic isn’t as it used to be.

    If any easier, would it be possible to help me write a standalone query, for placement within the Tribe single-organizer.php template (both attached and pasted below), instead? Like the native tribe_organizer_upcoming_events function, the idea——in theory——would be for it to find any Tribe single event post where the organizer ID was added to the event meta, and return each given event ID.

    In other words, it would look for any Tribe event where the given organizer ID is selected via the ACF Pro field “the_organizers”.

    I’ve also attached a detailed screenshot for additional reference, as well as a few potentially relevant example links:

    Single Event Page

    Speaker | Organizer Page
    (set by native Tribe field–upcoming event display)

    Speaker | Organizer Page
    (set by ACF relational object field–upcoming event not display)

    <?php
    /**
     * Single Organizer Template
     * The template for an organizer. By default it displays organizer information and lists
     * events that occur with the specified organizer.
     *
     * This view contains the filters required to create an effective single organizer view.
     *
     * You can recreate an ENTIRELY new single organizer view by doing a template override, and placing
     * a Single_Organizer.php file in a tribe-events/pro/ directory within your theme directory, which
     * will override the /views/pro/single_organizer.php.
     *
     * You can use any or all filters included in this file or create your own filters in
     * your functions.php. In order to modify or extend a single filter, please see our
     * readme on templates hooks and filters (TO-DO)
     *
     * @package TribeEventsCalendarPro
     *
     * @version 4.4.28
     */
    
    if ( ! defined( 'ABSPATH' ) ) {
    	die( '-1' );
    }
    
    $organizer_id = get_the_ID();
    ?>
    
    <?php while ( have_posts() ) : the_post(); ?>
    	<div class="tribe-events-organizer">
    			<p class="tribe-events-back">
    				<a href="<?php echo esc_url( tribe_get_events_link() ); ?>" rel="bookmark"><?php printf( __( '&larr; Back to %s', 'tribe-events-calendar-pro' ), tribe_get_event_label_plural() ); ?></a>
    			</p>
    
    		<?php do_action( 'tribe_events_single_organizer_before_organizer' ) ?>
    		<div class="tribe-events-organizer-meta tribe-clearfix">
    
    				<!-- Organizer Title -->
    				<?php do_action( 'tribe_events_single_organizer_before_title' ) ?>
    				<h1 class="tribe-organizer-name"><?php echo tribe_get_organizer( $organizer_id ); ?></h1>
    				<?php do_action( 'tribe_events_single_organizer_after_title' ) ?>
    
    				<!-- Organizer Meta -->
    				<?php do_action( 'tribe_events_single_organizer_before_the_meta' ); ?>
    				<?php echo tribe_get_organizer_details(); ?>
    				<?php do_action( 'tribe_events_single_organizer_after_the_meta' ) ?>
    
    				<!-- Organizer Featured Image -->
    				<?php echo tribe_event_featured_image( null, 'full' ) ?>
    
    				<!-- Organizer Content -->
    				<?php if ( get_the_content() ) { ?>
    				<div class="tribe-organizer-description tribe-events-content">
    					<?php the_content(); ?>
    				</div>
    				<?php } ?>
    
    			</div>
    			<!-- .tribe-events-organizer-meta -->
    		<?php do_action( 'tribe_events_single_organizer_after_organizer' ) ?>
    
    		<!-- Upcoming event list -->
    		<?php do_action( 'tribe_events_single_organizer_before_upcoming_events' ) ?>
    
    		<?php
    		// Use the tribe_events_single_organizer_posts_per_page to filter the number of events to get here.
    		echo tribe_organizer_upcoming_events( $organizer_id ); ?>
    
    		<?php do_action( 'tribe_events_single_organizer_after_upcoming_events' ) ?>
    
    	</div><!-- .tribe-events-organizer -->
    	<?php
    	do_action( 'tribe_events_single_organizer_after_template' );
    endwhile;
  • Got it! If this is of any use to anyone else, here is the working template:

    <?php
    /**
     * Single Event Meta (Organizer) Template
     *
     * Override this template in your own theme by creating a file at:
     * [your-theme]/tribe-events/modules/meta/organizer.php
     *
     * @package TribeEventsCalendar
     * @version 4.4
     */
    
    ?>
    
    <div class="tribe-events-meta-group tribe-events-meta-group-organizer">
    	<h3 class="tribe-events-single-section-title"><?php echo "Organizers"; ?></h3>
    	<dl>
    		
    	<?php	$posts = get_field('the_organizers');?>
    	
    	<?php foreach( $posts as $p ): // variable must NOT be called $post (IMPORTANT) ?>
    	    <dt style="display:none;"><?php // This element is just to make sure we have a valid HTML ?></dt>
    			<dd class="tribe-organizer">
    	    	<a href="<?php echo get_permalink( $p->ID ); ?>"><?php echo get_the_title( $p->ID ); ?></a>
    	    	<?php the_field('author', $p->ID); ?>
    	    </dd>
    	<?php endforeach; ?>
    	
    	<?php do_action( 'tribe_events_single_meta_organizer_section_end' ); 
    		?>
    	</dl>
    </div>
  • Including a screenshot of the frontend

  • Found in this thread here: https://theeventscalendar.com/support/forums/topic/where-to-place-acf_form_head-to-save-submitted-data/#dl_post-1364986

    An Events Calendar Pro dev created a snippet, and though I placed it within my functions.php file, none of the data entered in the ACF fields is saved upon hitting submit on the front-end (it does save when editing via admin backend). Still, I’m hoping it potentially offers some clues:

    <?php
    /**
     * The Events Calendar - Community Events: Enqueue Advanced Custom Fields into
     * the Community Events add/edit form pages.
     *
     * This will get ACF loaded but you will need to add your own additional code to
     * get ACF to do anything at all on the Community Events forms.
     *
     * @see cliff_is_community_page
     *
     * @link https://gist.github.com/cliffordp/9c88e97e5f2392b1c36eabb248a50b11
     * @link https://www.advancedcustomfields.com/
     * @link https://theeventscalendar.com/support/forums/topic/where-to-place-acf_form_head-to-save-submitted-data/
     */
    add_action( 'wp_head', 'cliff_add_acf_to_ce' );
    
    function cliff_add_acf_to_ce() {
    	if (
    		! function_exists( 'acf_form_head' )
    		|| ! function_exists( 'cliff_is_community_page' )
    		|| false === cliff_is_community_page()
    	) {
    		return;
    	}
    
    	acf_form_head();
    }
    
    /**
     * Return TRUE if we are in the Community Events Add Event or Edit Event form.
     *
     * @return bool
     */
    function cliff_is_community_page() {
    	$main = tribe( 'community.main' );
    
    	if ( empty( $main ) ) {
    		// Community Events is not active (or may somehow not be loaded correctly)
    		return false;
    	}
    
    	$event_post_type = Tribe__Events__Main::POSTTYPE;
    	$action          = Tribe__Utils__Array::get( $main->context, 'action' );
    	$ce_post_type    = Tribe__Utils__Array::get( $main->context, 'post_type', $event_post_type ); // assume event post type if not set
    
    	// bail if we are not doing what is expected from the start
    	if ( $event_post_type !== $ce_post_type ) {
    		return false;
    	}
    
    	if (
    		'edit' === $action
    		|| 'add' === $action
    	) {
    		return true;
    	} else {
    		// if empty( $action ), you might be in the Community Events List view
    		return false;
    	}
    }

    I should also note that he described the CE front-end form like this:

    “The Community Events form is actually not a regular WordPress post or archive page; it’s a WP Router “page”.

    tribe_events_community_form might be the action hook you’re looking for. I found it in the render() method inside /wp-content/plugins/the-events-calendar-community-events/src/Tribe/Event_Form.php

    Please let me know how this goes for you.”

    And:

    “Since you want it in wp_head(), I think the best way is to actually use that hook.

    You could reference this is_community_page() method as a check inside the code you hook into wp_head(): https://github.com/moderntribe/products-extensions/blob/master/tribe-ext-community-currency-symbol/index.php#L294-L331&#8221;

  • Hello again, John.

    I’ve tried the code you posted in my functions.php file with no luck. That actually broke the submittal process entirely—basically causing the submittal form/page to refresh with not even the fields native fields retained.

    Next, I tried adding acf_form_head() to both my theme (Avada) and plugin (Events Calendar) template files, per the suggestion of the dev at TEC, the thread found here in it’s entirety:

    I looked around a bit and might have found something that could help.

    There is a template file,

    \the-events-calendar\src\views\default-template.php

    which you can override (=> Themer’s Guide), that has a ‘get_header()’ in it.

    For this template to work you will need to have the setting Events > Settings > Display tab > Events Tempate > Default Events Template.

    If you want to use the ‘Default Page Template’ setting, then you either need to look around in your theme’s template files, search for it and add it there. If you have a page.php file in your theme, then that would be your best bet.

    In this case it is also recommended to use a child theme, so that your settings don’t get lost with a theme update.

    Let me know if this helps you move forward.

    So, first I tried adding it to the template I am currently using: Default Page Template (page.php) – no luck.

    And then I changed the template file I’m using to the Default Events Template (default-events.php) – still no luck.

    I also received another suggestion from a different dev in a different section of the support forum:

    The Community Events form is actually not a regular WordPress post or archive page; it’s a WP Router “page”.

    tribe_events_community_form might be the action hook you’re looking for. I found it in the render() method inside /wp-content/plugins/the-events-calendar-community-events/src/Tribe/Event_Form.php

    Please let me know how this goes for you.

    I tried placing it where I understood was suggested—as seen in attached screenshot—but that failed as well.

    Does this offer any useful clues? Should I provide you the full code found with Event_Form.php?

  • I’ve been unsuccessful in finding a place to insert the acf_form_head() call.

    With the one you provided, since it seems designed to apply to the entire site, is there an obvious place to insert it? Are you aware of any potential drawbacks to having it apply to the entire site?

  • John,

    Believe it or not, after plugging in the acf_form call you provided, it is now displaying! I’ll need to tweak the CSS a bit to get it to show up more cleanly, but other than that, is there anything else I should worry about?

    Any reason to suspect it won’t register the info entered or anything like that? Must I still look into modifying the header to include the call to acf_form_head() like you mentioned?

  • Following up:

    I tried registering the form first with <?php acf_register_form( $settings ); ?> but this did not work either. I’m not sure if I’m entering the code wrong, or if I’m on the wrong path entirely.

    Here it is with acf_register_form:

    <?php
    /**
     * Event Submission Form
     * The wrapper template for the event submission form.
     *
     * Override this template in your own theme by creating a file at
     * [your-theme]/tribe-events/community/edit-event.php
     *
     * @since    3.1
     * @version  4.5
     *
     * @var int|string $tribe_event_id
     */
    
    if ( ! defined( 'ABSPATH' ) ) {
    	die( '-1' );
    }
    
    if ( ! isset( $tribe_event_id ) ) {
    	$tribe_event_id = null;
    }
    
    ?>
    
    <?php tribe_get_template_part( 'community/modules/header-links' ); ?>
    
    <?php do_action( 'tribe_events_community_form_before_template', $tribe_event_id ); ?>
    
    <?php acf_register_form( $settings );
    
    $settings = array(
    /* (string) Unique identifier for the form. Defaults to 'acf-form' */
    	'id' => 'acf-group_59dd13c80be9e',
    	
    	/* (boolean) Whether or not to create a form element. Useful when a adding to an existing form. Defaults to true */
    	'form' => false
    			
    );?>
    
    <form method="post" enctype="multipart/form-data" data-datepicker_format="<?php echo esc_attr( tribe_get_option( 'datepickerFormat', 0 ) ); ?>">
    	<input type="hidden" name="post_ID" id="post_ID" value="<?php echo absint( $tribe_event_id ); ?>"/>
    	<?php wp_nonce_field( 'ecp_event_submission' ); ?>
    
    	<?php tribe_get_template_part( 'community/modules/title' ); ?>
    	
    	<?php acf_form( $options );
    	$settings = array(
    
    	/* (string) Unique identifier for the form. Defaults to 'acf-form' */
    	'id' => 'acf-group_59dd13c80be9e',
    	
    	/* (boolean) Whether or not to create a form element. Useful when a adding to an existing form. Defaults to true */
    	'form' => false
    			
    );?>
    
    	<?php tribe_get_template_part( 'community/modules/description' ); ?>
    
    	<?php tribe_get_template_part( 'community/modules/datepickers' ); ?>
    
    	<?php tribe_get_template_part( 'community/modules/image' ); ?>
    
    	<?php tribe_get_template_part( 'community/modules/taxonomy', null, array( 'taxonomy' => Tribe__Events__Main::TAXONOMY ) ); ?>
    
    	<?php tribe_get_template_part( 'community/modules/taxonomy', null, array( 'taxonomy' => 'post_tag' ) ); ?>
    
    	<?php tribe_get_template_part( 'community/modules/venue' ); ?>
    
    	<?php tribe_get_template_part( 'community/modules/organizer' ); ?>
    
    	<?php tribe_get_template_part( 'community/modules/website' ); ?>
    
    	<?php tribe_get_template_part( 'community/modules/custom' ); ?>
    
    	<?php tribe_get_template_part( 'community/modules/cost' ); ?>
    
    	<?php tribe_get_template_part( 'community/modules/spam-control' ); ?>
    
    	<?php tribe_get_template_part( 'community/modules/submit' ); ?>
    </form>
    
    <?php do_action( 'tribe_events_community_form_after_template', $tribe_event_id ); ?>
    
Viewing 25 posts - 1 through 25 (of 26 total)