Godwin_
Forum Replies Created
-
Forum: Plugins
In reply to: [The Events Calendar] Interferes with ACF Relationship FieldI too came across this issue. My relationship custom field was on events (selecting from a list of my own custom types). I did a bit of digging around both plugins to try to determine what was going wrong and also found that removing
tribe_events
from the post types initially solved the problem, but I also neededtribe_events
to come up in other areas of the site.I wasn’t able to get much further than this, and although the only progress I made was through modifying the ACF plugin, it suggests to me that it originally comes from TEC.
My final workaround was unfortunately to hack the code in ACF. I changed the
format_value
function in\core\fields\relationship.php
at line 694. I changed:
$posts = get_posts(array(
'numberposts' => -1,
'post__in' => $value,
'post_type' => apply_filters('acf/get_post_types', array()),
'post_status' => array('publish', 'private', 'draft', 'inherit', 'future'),
));
to:
$types = apply_filters('acf/get_post_types', array());
unset($types['tribe_events']);
$posts = get_posts(array(
'numberposts' => -1,
'post__in' => $value,
'post_type' => $types,
'post_status' => array('publish', 'private', 'draft', 'inherit', 'future'),
));
I also notified the folks at Tribe of the problem in case they weren’t aware of it yet.