Skip to content Skip to sidebar

This thread is resolved. Here is a description of the problem and solution.

Problem:
You are using WPML with WP-Event Manager Plugin and its Registrations Addon to set a Registration Limit. The site's default language is German, with an English translation. You've encountered an issue where the Registration Limit does not copy for the English translation. After applying a fix from WPML's errata page, it incorrectly combines all different registrations of all events into one in the English translation, causing the registration count to decrease incorrectly.

Solution:
We recommend applying a specific workaround from the WPML errata page for the WP-Event Manager Registrations Addon issue with registration limit not being synchronized between languages. You can find the workaround here.

For the code replacements at lines 497 and 595, use the following custom functions:

if ( ! function_exists( 'get_event_registration_count' ) ) {<br />    function get_event_registration_count( $event_id ) {<br />        $element_type = 'post_' . get_post_type( $event_id );<br />        $trid = apply_filters( 'wpml_element_trid', null, $event_id, $element_type );<br />        $translations = apply_filters( 'wpml_get_element_translations', null, $trid, $element_type );<br />        $event_ids = array_map( function ( $translation ) {<br />            return $translation->element_id;<br />        }, $translations );<br />        return sizeof( get_posts( array(<br />            'post_type'       => 'event_registration',<br />            'post_status'     => array_merge( array_keys( get_event_registration_statuses() ), array( 'publish' ) ),<br />            'posts_per_page'  => -1,<br />            'fields'          => 'ids',<br />            'post_parent__in' => $event_ids,<br />        ) ) );<br />    }<br />}<br />
if ( ! function_exists( 'user_has_registered_for_event' ) ) {<br />    function user_has_registered_for_event( $user_id, $event_id ) {<br />        if ( ! $user_id ) {<br />            return false;<br />        }<br />        $element_type = 'post_' . get_post_type( $event_id );<br />        $trid = apply_filters( 'wpml_element_trid', null, $event_id, $element_type );<br />        $translations = apply_filters( 'wpml_get_element_translations', null, $trid, $element_type );<br />        $event_ids = array_map( function ( $translation ) {<br />            return $translation->element_id;<br />        }, $translations );<br />        return sizeof( get_posts( array(<br />            'post_type'       => 'event_registration',<br />            'post_status'     => array_merge( array_keys( get_event_registration_statuses() ), array( 'publish' ) ),<br />            'posts_per_page'  => 1,<br />            'fields'          => 'ids',<br />            'post_parent__in' => $event_ids,<br />            'meta_query'      => array(<br />                array(<br />                    'key'   => '_attendee_user_id',<br />                    'value' => absint( $user_id )<br />                )<br />            )<br />        ) ) ) > 0;<br />    }<br />}<br />

If this solution does not resolve your issue or seems outdated, please check related known issues at https://wpml.org/known-issues/, verify the version of the permanent fix, and confirm that you have installed the latest versions of themes and plugins. If the problem persists, we highly recommend opening a new support ticket for further assistance.

This is the technical support forum for WPML - the multilingual WordPress plugin.

Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.

Tagged: 

This topic contains 9 replies, has 0 voices.

Last updated by timoR-12 1 month ago.

Assisted by: Bruno Kos.

Author Posts
September 7, 2025 at 9:39 am #17381627

timoR-12

Background of the issue:
I'm using WPML and WP-Event Manager Plugin along with the WP-Event Manager Registrations Addon to set a Registration Limit. The site default is in German, with an English translation. I've tried implementing a fix from WPML's errata page.

Symptoms:
The Registration Limit does not copy for the English translation. After applying the fix, it combines all the different registrations of all events into one in the English translation, causing the registration count to decrease incorrectly.

Questions:
Why does the Registration Limit not copy for the English translation?
Why does the registration count decrease incorrectly for each event in the English translation after applying the fix?

September 8, 2025 at 8:45 am #17382735

Bruno Kos
WPML Supporter since 12/2018

Languages: English (English ) German (Deutsch ) French (Français )

Timezone: Europe/Zagreb (GMT+02:00)

Thank you for taking the time to reproduce this issue on the sandbox site. From your description, it looks like the problem persists on translated events, though the behavior is slightly different compared to your live site.

To escalate this properly to our compatibility team, could you please:

1. Confirm whether the workaround code was applied when you tested on the sandbox.
2. Share the exact steps you followed (e.g., create event → set limit → translate → register → check spots left).
3. Provide a couple of screenshots or a short screen recording showing the difference between the default language (DE) and the translation (EN).

These details will help our team reproduce the issue consistently and work toward a permanent fix.

Can you tell me I missed something here? Let me know if you have any questions.

September 13, 2025 at 3:58 pm #17399361

timoR-12

Hi

1. Yes, I applied the workaround code to test it on the sandbox. Again, Without the workaround code, registration limits do not get synchronized at all between original and translated events. With the workaround code, registration limits get synchronized between DIFFERENT events (only translated).

My assumtpion is that the workaround code just straight up does not work/is set up wrong, but I unfortunately do not have the php coding skills to investigate further.

2. Exact steps: create events -> set limit -> translate -> register -> check spots left. Same thing also happens when translating before setting a limit.

3. I can even share you links to a staging environment/clone of the site I set up, you can look at it. If you need, I can give you access to the backend aswell.

I have a site with a couple of different Events. The registration limit on all events is set to 10. In total, 8 people have signed up (for different events). For the specific event we are going to look at, 3 people signed up (out of the total 8 registrations).

On the default Language this works perfectly: hidden link
3 people signed up, showing 7 spots lefts, everything looks good.

However on the english translation:
hidden link
It shows only 2 spots left, because it counts all TOTAL registrations (8).

This issue persists also with OTHER translated events on the page (you can have a look at them under 'Courses')

I will show you with another Event, where NO ONE has signed up:
On the default Language, 10 spots left:
hidden link

On the english translation, 2 spots left:
hidden link

This stays consistent, if a new registration happens, the counter goes down by 1 on ALL translated Events.

I hope this helps. If you need anything else like access to the staging environment please let me know and please update me on any progress made. I run a site for a client which uses wp event manager and wpml to translate signups for university courses and the resolving of this bug is crucial for us.

Thank you very much for your efforts!

September 15, 2025 at 9:57 am #17401390

Bruno Kos
WPML Supporter since 12/2018

Languages: English (English ) German (Deutsch ) French (Français )

Timezone: Europe/Zagreb (GMT+02:00)

OK, given the nature of this issue, can you confirm once again if this is what happens?

### Case A – Without workaround code

1. Create Event A (DE) → set Registration Limit = 10 → publish.
2. Translate Event A into EN.
3. Register for Event A (DE) twice.
4. Observe: DE shows 8 left.
5. Problem: EN still shows full 10 (limit not copied).

### Case B – With workaround code (from WPML Errata)

1. Create Event B (DE) → set Registration Limit = 10 → publish.
2. Translate Event B into EN.
3. Register for Event B (DE) twice.
4. Observe: DE shows 8 left.
5. Problem: EN also shows reduced spots (8 left), but this reduction is applied to all other EN events, even those unrelated or with 0 registrations.

### Expected vs Actual

Expected:

Each DE and EN version of the same event should share the same limit and decrease independently per event.

Actual:

* Without workaround: EN ignores registration limits.
* With workaround: EN events share a pooled limit, so registering in one event reduces spots in all EN events.

As given the nature of the issue, it is possible that the solution from the errata is applied to all other EN events but we did not notice it.

September 15, 2025 at 10:31 am #17401556

timoR-12

Yes, I can confirm this is exactly what happens.

September 15, 2025 at 3:25 pm #17403255

timoR-12

I wanted to quickly specify:

Actual:
*Without workaround: The EN does not COMPLETELY ignore registration limits.

It ignores the original registration limits from the DE events, but has its own separate registration limits.

Basically it duplicates the events, rather than linking the registration limits across translations. So one could register for the same Event for both the EN and the DE Version seperately.

Just a small thing, but maybe good to know upfront if your development team is going to tackle the actual bug, rather than the workaround.

September 16, 2025 at 8:55 am #17405052

Bruno Kos
WPML Supporter since 12/2018

Languages: English (English ) German (Deutsch ) French (Français )

Timezone: Europe/Zagreb (GMT+02:00)

Thank you for an update, I am checking with with our compatibility team and will keep you posted.

September 16, 2025 at 11:48 am #17405955

Bruno Kos
WPML Supporter since 12/2018

Languages: English (English ) German (Deutsch ) French (Français )

Timezone: Europe/Zagreb (GMT+02:00)

Escalated to Compatibility team. I will keep you posted!

September 18, 2025 at 5:47 am #17411607

Bruno Kos
WPML Supporter since 12/2018

Languages: English (English ) German (Deutsch ) French (Français )

Timezone: Europe/Zagreb (GMT+02:00)

Can you try this? So this workaround:
https://wpml.org/errata/wp-event-manager-registrations-addon-registration-limit-not-synchronized-between-languages/

But for the 2 replacements (line 497 and 595), use the following:

if ( ! function_exists( 'get_event_registration_count' ) ) {
    /**
     * Get number of registrations for an event
     * @param  int $event_id
     * @return int
     */
    function get_event_registration_count( $event_id ) {

        // WPML workaround for compsupp-7562 - Part I
        $element_type = 'post_' . get_post_type( $event_id );
        $trid = apply_filters( 'wpml_element_trid', null, $event_id, $element_type );
        $translations = apply_filters( 'wpml_get_element_translations', null, $trid, $element_type );

        // Extract the IDs of the translated posts
        $event_ids = array_map( function ( $translation ) {
            return $translation->element_id;
        }, $translations );

        // Get event registrations for all translations
        return sizeof( get_posts( array(
            'post_type'       => 'event_registration',
            'post_status'     => array_merge( array_keys( get_event_registration_statuses() ), array( 'publish' ) ),
            'posts_per_page'  => -1,
            'fields'          => 'ids',
            'post_parent__in' => $event_ids, // Get all registrations for the event IDs
        ) ) );
    }
}

and:

if ( ! function_exists( 'user_has_registered_for_event' ) ) {
    /**
     * See if a user has already applied for an event
     * @param  int $user_id, $event_id
     * @return bool
     */
    function user_has_registered_for_event( $user_id, $event_id ) {
        if ( ! $user_id ) {
            return false;
        }

        // WPML Workaround for compsupp-7562 - Part II
        $element_type = 'post_' . get_post_type( $event_id );
        $trid = apply_filters( 'wpml_element_trid', null, $event_id, $element_type );
        $translations = apply_filters( 'wpml_get_element_translations', null, $trid, $element_type );

        // Extract the IDs of the translated posts
        $event_ids = array_map( function ( $translation ) {
            return $translation->element_id;
        }, $translations );

        // Check if the user is registered for any translation of the event
        return sizeof( get_posts( array(
            'post_type'       => 'event_registration',
            'post_status'     => array_merge( array_keys( get_event_registration_statuses() ), array( 'publish' ) ),
            'posts_per_page'  => 1,
            'fields'          => 'ids',
            'post_parent__in' => $event_ids, // Check all event translations
            'meta_query'      => array(
                array(
                    'key'   => '_attendee_user_id',
                    'value' => absint( $user_id )
                )
            )
        ) ) ) > 0;
    }
}

Does it work properly now?

September 18, 2025 at 7:21 am #17411748

timoR-12

Works like a charm! Thank you very much for your help!