/**
* Updates the contactmethods with an additional set of social profiles.
*
* These are used with the Facebook author, rel="author", Twitter cards implementation, but also in the sameAs schema attributes.
*
* @param array<string, string> $contactmethods Currently set contactmethods.
*
* @return array<string, string> Contactmethods with added contactmethods.
*/
public function update_contactmethods( $contactmethods ) {
$additional_contactmethods = $this->additional_contactmethods_collector->get_additional_contactmethods_objects();
if( is_array($contactmethods) ){
return \array_merge( ( $contactmethods ?? [] ), $additional_contactmethods );
}
else{
return [];
}
}
In wordpress-seo/src/user-meta/user-interface/additional-contactmethods-integration.php the return should be updated to solve the error. This is a quick and easy appaorach, but does the trick. Is there anything I can do to get a fix like this into Yoast core?
Hi @devdevdev998
As you have noticed the issue and fixed it within the code, you can submit it as a patch so that our development can review it and merge it into the Yoast SEO plugin code. You can read more on how to contribute to the Yoast SEO plugin here.
As the fatal error does not occur on a fresh install of the Yoast SEO plugin, it may occur on a specific setup, case, or by another plugin or theme. So, I would recommend you submit more details within the PR on how to reproduce this issue, as it will help our developers review it more easily.
Thanks in advance.
-
This reply was modified 1 year, 4 months ago by
Jose Varghese. Reason: Removed the html tag