Skip to content

Commit

Permalink
Avoid warning with invalid tax queries (#681)
Browse files Browse the repository at this point in the history
  • Loading branch information
dd32 authored Apr 22, 2024
1 parent 369e7c7 commit d895a72
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,7 @@ function add_social_meta_tags() {
'og:url' => home_url(),
'og:image' => esc_url( $default_image ),
];
} else if ( is_tax() ) {
} else if ( is_tax() && get_queried_object() ) {
$og_fields = [
'og:title' => sprintf( __( 'Block Patterns: %s', 'wporg-patterns' ), esc_attr( single_term_title( '', false ) ) ),
'og:description' => __( 'Add a beautifully designed, ready to go layout to any WordPress site with a simple copy/paste.', 'wporg-patterns' ),
Expand Down

0 comments on commit d895a72

Please sign in to comment.