Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I have Pods and WPML installed, and I have SitePress Multilingual CMS extension installed for WPML, and I have many custom post types which I've added using Pods.

Recently when I was checking the website after adding ?lang=ar to the end of the URL to check how everything looks (I haven't translated anything yet), I got a PHP Notice, it was repeated 46 times above the header, and it said:

Notice: Invalid object kind: _pods_field in /my/website/path/wp-content/plugins/sitepress-multilingual-cms/inc/template-functions.php on line 194

When I checked line 194 in template-functions.php, I found the following:

$post_types = array_keys((array) $wp_post_types);
$taxonomies = array_keys((array) $wp_taxonomies);
$element_types = array_merge($post_types, $taxonomies);
$element_types[] = 'comment';

if (!in_array($element_type, $element_types)) {
    trigger_error(sprintf(__('Invalid object kind: %s', 'sitepress'), $element_type), E_USER_NOTICE);
    return null;
}

I know it's just a PHP Notice that can be ignored, but I've found that the translated version of the website loads in 5X the time that the normal site takes, and I think that these 46 errors are the reason why it's so slow. I've tried removing all widgets, removing the navigation menu, clearing Pods cache, and nothing seems to work.

share|improve this question

closed as off-topic by Pieter Goosen, birgire, Johannes Pille, Wyck, mrwweb Sep 8 at 0:38

This question appears to be off-topic. The users who voted to close gave these specific reasons:

If this question can be reworded to fit the rules in the help center, please edit the question.

1 Answer 1

up vote 0 down vote accepted

I've already fixed it. I simply had to go to WPML > Languages, and uncheck "Adjust IDs for multilingual functionality" which dramatically increased the performance of the translated version of the website, and I no longer get a PHP notice.

share|improve this answer
    
Yeah, that is a big performance killer! –  Scott Kingsley Clark Jun 10 at 14:42

Not the answer you're looking for? Browse other questions tagged or ask your own question.