diff --git a/inc/class-metadata.php b/inc/class-metadata.php index 5a39819..4f5a4f3 100644 --- a/inc/class-metadata.php +++ b/inc/class-metadata.php @@ -16,6 +16,11 @@ public function init(): void { add_filter( 'the_seo_framework_meta_render_data', [ $this, 'the_seo_framework_meta_render_data' ], PHP_INT_MAX ); } + /** + * @param mixed $title + * @psalm-param array{id?: int}|null $args + * @psalm-suppress RiskyTruthyFalsyComparison + */ public function the_seo_framework_title_from_generation( $title, ?array $args ): string { if ( null === $args && is_singular( 'criminal' ) ) { $title = get_the_title(); @@ -23,7 +28,7 @@ public function the_seo_framework_title_from_generation( $title, ?array $args ): $title = get_the_title( $args['id'] ); } - return $title; + return (string) $title; } public function the_seo_framework_meta_render_data( array $data ): array {