Skip Navigation

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

Problem:
The client was experiencing a fatal error caused by an ArgumentCountError in the WPML String Translation plugin, which prevented access to the WordPress admin area.

Solution:
We identified that the issue was related to the client's theme functions.php file, where the code used to register the ACF options page was missing text-domains. We provided a corrected version of the code with the appropriate text-domains:

function theme_option_init()
{
    // Check function exists.
    if (function_exists('acf_add_options_page')) {
        // Add parent.
        $parent = acf_add_options_page(array(
            'page_title'  => __('Theme General Settings', 'pjisrael'),
            'menu_title'  => __('Theme Settings', 'pjisrael'),
            'capability'    => 'edit_posts',
            'redirect'      => false
        ));
        // Add sub page.
        $child = acf_add_options_page(array(
            'page_title'  => __('Footer Settings', 'pjisrael'),
            'menu_title'  => __('Footer', 'pjisrael'),
            'parent_slug' => $parent['menu_slug'],
        ));
    }
}
add_action('acf/init', 'theme_option_init');

We asked the client to check and confirm if the issue was resolved.

Please note that this solution might be irrelevant if it's outdated or not applicable to your case. If you're still experiencing issues, we highly recommend checking the related known issues, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins. If the problem persists, please open a new support ticket with us.

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 2 voices.

Last updated by Shekhar Bhandari 1 year, 2 months ago.

Assisted by: Shekhar Bhandari.

Author Posts
May 6, 2024 at 5:47 am

shaid-3

Fatal error: Uncaught ArgumentCountError: 10 arguments are required, 2 given in /wp-content/plugins/wpml-string-translation/classes/translations-file-scan/wpml-st-translations-file-registration.php:105

May 6, 2024 at 7:05 am
May 6, 2024 at 7:06 am #15595230

Shekhar Bhandari
WPML Supporter since 03/2015

Languages: English (English )

Timezone: Asia/Kathmandu (GMT+05:45)

Hello Said,

I have moved the chat to an forum ticket.

Can you zip the backup files and share us using some file sharing platform, so we can debug this further.

I have enabled the private reply for you.

Look forward to your reply.

Thanks

May 6, 2024 at 7:49 am
May 6, 2024 at 7:52 am #15595712

Shekhar Bhandari
WPML Supporter since 03/2015

Languages: English (English )

Timezone: Asia/Kathmandu (GMT+05:45)

Hello there,

You can reach out to your hosting and see if they have some options for backup, or you can download wp-content backup and database backup from them and share us with using file sharing platforms.

Look forward to your reply.

Thanks

May 6, 2024 at 7:56 am #15595717

shaid-3

i do have backup
what excatly you need?
db? files? how to upload them?

May 6, 2024 at 8:38 am #15595920

shaid-3

please try to answer more frequent
we can't update your site content

May 6, 2024 at 8:57 am #15595984

Shekhar Bhandari
WPML Supporter since 03/2015

Languages: English (English )

Timezone: Asia/Kathmandu (GMT+05:45)

Hello there,

I would need database and wp-content backup, you can upload those files to google drive and share the links with me.

I have enabled the private reply for you.

Look forward to your reply.

Thanks

May 6, 2024 at 10:08 am
May 6, 2024 at 10:14 am #15596483

Shekhar Bhandari
WPML Supporter since 03/2015

Languages: English (English )

Timezone: Asia/Kathmandu (GMT+05:45)

Hello there,

I couldn't see any sql on the provided zip, can you check?

You can edit your previous private reply to send the details in private.

Look forward to your reply.

Thanks

May 6, 2024 at 11:44 am #15596960

Shekhar Bhandari
WPML Supporter since 03/2015

Languages: English (English )

Timezone: Asia/Kathmandu (GMT+05:45)

Hello there,

Can you please check the issue now.

On your theme functions.php file the following code was used to register the acf options page,

function theme_option_init() {
  // Check function exists.
  if( function_exists('acf_add_options_page') ) {
    // Add parent.
    $parent = acf_add_options_page(array(
        'page_title'  => __('Theme General Settings'),
        'menu_title'  => __('Theme Settings'),
        'redirect'    => false,
    )); 
    // Add sub page.
    $child = acf_add_options_page(array(
        'page_title'  => __('Footer Settings'),
        'menu_title'  => __('Footer'),
        'parent_slug' => $parent['menu_slug'],
    ));
  }
}
add_action('acf/init', 'theme_option_init');

Which was missing text-domains, I modified the code as below and the issue is fixed

function theme_option_init()
{
    // Check function exists.
    if (function_exists('acf_add_options_page')) {
        // Add parent.
        $parent = acf_add_options_page(array(
            'page_title'  => __('Theme General Settings', 'pjisrael'),
            'menu_title'  => __('Theme Settings', 'pjisrael'),
            'capability'    => 'edit_posts',
            'redirect'      => false
        ));
        // Add sub page.
        $child = acf_add_options_page(array(
            'page_title'  => __('Footer Settings', 'pjisrael'),
            'menu_title'  => __('Footer', 'pjisrael'),
            'parent_slug' => $parent['menu_slug'],
        ));
    }
}
add_action('acf/init', 'theme_option_init');

Please check and confirm.

Look forward to your reply.

Thanks

May 6, 2024 at 11:55 am #15597056

shaid-3

have you updated the site code? or do i need to patch it?

May 6, 2024 at 11:56 am #15597142

Shekhar Bhandari
WPML Supporter since 03/2015

Languages: English (English )

Timezone: Asia/Kathmandu (GMT+05:45)

I have added the modified code already at your site.

May 6, 2024 at 11:57 am #15597143

shaid-3

thank you so much!