Hi @almendron,
Can you tell us more about your site? Your site URL, the plugins you use, and if you use any plugin(s) that modify the output of Twitter Cards by hooking into the jetpack_sharing_twitter_via
filter?
If you’d rather take this straight to our developers, you could create an issue on the Jetpack Github repo with the details requested above.
Thanks!
I found out what the problem was
Social module: deactivated
Share module: activated
Twitter site tag: no relevance
Filter on archive functions.php. This is what causes the error
add_filter ( 'jetpack_sharing_twitter_via', 'afn_add_twitterhandle_via' );
function afn_add_twitterhandle_via() {
if (!is_user_logged_in() ):
return 'XXXXXXXX';
endif;
}
It should be changed to
add_filter ( 'jetpack_sharing_twitter_via', 'afn_add_twitterhandle_via' );
function afn_add_twitterhandle_via() {
if (is_user_logged_in() ):
return '';
else :
return 'XXXXXXXX';
endif;
}
sharing-sources.php:
$twitter_site_tag_value = apply_filters( 'jetpack_sharing_twitter_via', $twitter_site_tag_value, $post->ID );
return preg_replace( '/[^\da-z_]+/i', '', $twitter_site_tag_value );
If the value of the variable “$twitter_site_tag_value” is null or empty, then “preg_replace” fails.
Hi @almendron –
Thanks for letting us know this is resolved and sharing the solution in case others run into a similar
I’m going to mark this thread as resolved. If you have additional questions about Jetpack in the future, feel free to open a new thread.