Closed niallkennedy closed 7 years ago
I don't think we are actively considering integrations with other extensions at the moment.
@omarreiss do we (potentially) want this?
As @rarst said we are not going to build in specific plugin integrations. We are always open for specific filter requests if those are providing solutions to specific problems.
Sites with both Yoast SEO and the official Twitter plugin for WordPress installed may output multiple sets of Twitter Cards markup, competing for a slot in the final indexed content by Twitter's Card indexer. The Twitter plugin may be better at preparing and optimizing content for Twitter. Yoast may be better at collecting custom titles and descriptions. Creating awareness of other plugins touching the same outputs helps build the best final result for publishers.
Functionality is expected to be similar to the
WPSEO_OpenGraph::facebook_filter
method handler, but with per-field filters instead of a general filtered array.Detect if the plugin is activated and the cards feature is present by testing for the
array('\Twitter\WordPress\Head\CardsMetaElements', 'outputMetaElements')
callback attached towp_head
afterwp_head
priority 1. Link to hook in code.Override the card type selected by the Twitter plugin for WordPress by acting on the
twitter_card_type
filter if you believe Yoast SEO has done a better job selecting the card type for the WordPress view. The Twitter plugin for WordPress does not supportplayer
orapp
card types. Returning an unsupported card type will result in no Twitter Cards markup.Change a Twitter Card title or description by acting on the
twitter_card_title
ortwitter_card_description
filter respectively. The value is only passed to the filter if not explicitly defined in a post meta box or other settings field. The query type and object id parameters passed with the filter provide information similar to what you'd expect in WP_Query.An associative array of properties are passed through the
twitter_card
filter before they are output as meta elements. Animage
key will exist on the passed array with either an absolute URI string value or an associative array containingsrc
,width
,height
keys. An existing image may have been chosen based on minimum dimensions requirements of the card and the maximum file size supported by Twitter.A site username passes through the
twitter_site_username
filter. This value may be used to set thetwitter:site
meta element and thevia
attribution of a Tweet intent. Thetwitter_via_username
filter should be used if you want to affect onlyvia
attribution.The author username passes through the
twitter_username
filter after it is pulled from thetwitter
user meta or attribute value. This value may be used to set thetwitter:creator
meta element, initialize a follow intent when initialized without a username, and setrelated
Twitter accounts on a Tweet intent.