Site logo

Archived topic

Custom Post Type with "has_archive" => false breaks Elements Display

3 replies · Started by Pierre on January 23, 2019

Viewing posts 1–4 of 4

It took me some time to figure out what was the problem. The Appearance > Elements display was broken. On my dev website, it displayed the custom taxonomies list, that were supposed to be in the select list under Display Rules, in the middle of the page...

I have custom post types with "has_archive" => false. In this case, $type['label'] (line 1143 in class-metabox.php) returns an empty value, breaking the construction of the select list.

Turning has_archive back to true fixed the problem.

I thought I'll let you know ;).
Best regards,
P

Hi there,

Thanks for reporting this.

Just to confirm, to replicate this I should create a custom post type with has_archive set to false. Is that it?

Let me know :)

Hi there,

I have this same problem. I registered custom taxonomy (with and without archive). In both cases notice appears in Elements when trying to configure Display Rules.

Notice:
Undefined index: label in [.......]/gp-premium/elements/class-metabox.php on line 1142

Regards
Jacek

GeneratePress 2.2.2
GP Premium 1.7.8

This archived topic is closed to new replies.