Site logo

Archived topic

Custom-Post-Type-Tax Post Meta Error in 3.0

3 replies · Started by Randall on October 3, 2020

Viewing posts 1–4 of 4

Hi,

I've installed 3.0rc1 and GP Premium 1.12.0 On a development copy of my site. I had previously installed GP Premium 1.12.0 without issue, this issue occurred after installing 3.0 rc1.

I am using a snippet that allows me to use a custom post type taxonomy in that post type's meta along with one other custom meta item. The function is based on this post: #1284466

With 3.0, I'm getting an "undefined index" error from debug that points to generatepress/inc/structure/post-meta.php on line 350.

I've tried to figure out how to filter or hook into the new function "generate_disable_post_meta_items" at that location, but am not having much luck. And not sure if that is what is required?

I've provided login details and a link to the snippet in private details.

Hi there,

Thanks for reporting this!

I believe I see the issue - any chance you can try the fix?

If so, replace this on line 350 in post-meta.php:

if ( ! apply_filters( $disable_filter_names[ $item ], $default_display ) ) {
    $items = array_diff( $items, array( $item ) );
}

With this:

if ( isset( $disable_filter_names[ $item ] ) && ! apply_filters( $disable_filter_names[ $item ], $default_display ) ) {
    $items = array_diff( $items, array( $item ) );
}

Let me know :)

No problem and yes, can confirm that fix works for me.

Thanks Tom!

Awesome, thanks for letting me know! Really appreciate it :)

This archived topic is closed to new replies.