• Resolved tnchuntic

    (@tnchuntic)


    Just reporting this bug, I think :). I have checked the code it seems that your directly concatenating string to object class which cause fatal error on php v8.1.0

    PHP Fatal error: Uncaught Error: Object of class WP_Post_Type could not be converted to string in /var/web/site/public_html/wp-content/plugins/breadcrumb-block/includes/breadcrumbs.php:345

    Current Code in breadcrumb-block/includes/breadcrumbs.php:345

    do_action( 'breadcrumb_block_single_' . $post_type, $post, $this );

    Fixed Code in breadcrumb-block/includes/breadcrumbs.php:345

    do_action( 'breadcrumb_block_single_' . $post_type->labels->name, $post, $this );

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Phi Phan

    (@mr2p)

    Thank you @tnchuntic very much for reporting the issue and providing a solution as well.

    I’ll update the code very soon.

    Thanks, Phi.

    Plugin Author Phi Phan

    (@mr2p)

    Hi @tnchuntic,

    Thank you again for reporting the issue. I’ve added a fix on the latest version. I’ve used $post_type->name instead of the singular label as your suggestion. That new hook allows you to add custom taxonomy to the breadcrumb for custom post type.

    Thanks, Phi.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Uncaught Error: Object of class WP_Post_Type could not be converted to string’ is closed to new replies.