| @@ -25,13 +25,15 @@ | ||
| 25 | 25 | public function present() { |
| 26 | 26 | $enhanced_data = $this->get(); |
| 27 | 27 | $twitter_tags = ''; |
| 28 | 28 | $i = 1; |
| 29 | + $class = \is_admin_bar_showing() ? ' class="yoast-seo-meta-tag"' : ''; | |
| 29 | 30 | foreach ( $enhanced_data as $label => $value ) { |
| 30 | - $twitter_tags .= \sprintf( "\t" . '<meta name="twitter:label%1$d" content="%2$s" />' . "\n", $i, $label ); | |
| 31 | - $twitter_tags .= \sprintf( "\t" . '<meta name="twitter:data%1$d" content="%2$s" />' . "\n", $i, $value ); | |
| 31 | + $twitter_tags .= \sprintf( "\t" . '<meta name="twitter:label%1$d" content="%2$s"' . $class . ' />' . "\n", $i, \esc_attr( $label ) ); | |
| 32 | + $twitter_tags .= \sprintf( "\t" . '<meta name="twitter:data%1$d" content="%2$s"' . $class . ' />' . "\n", $i, \esc_attr( $value ) ); | |
| 32 | 33 | ++$i; |
| 33 | 34 | } |
| 35 | + | |
| 34 | 36 | return \trim( $twitter_tags ); |
| 35 | 37 | } |
| 36 | 38 | |
| 37 | 39 | /** |
| @@ -55,10 +57,9 @@ | ||
| 55 | 57 | |
| 56 | 58 | /** |
| 57 | 59 | * Filter: 'wpseo_enhanced_slack_data' - Allows filtering of the enhanced data for sharing on Slack. |
| 58 | 60 | * |
| 59 | - * @api array $data The enhanced Slack sharing data. | |
| 60 | - * | |
| 61 | + * @param array $data The enhanced Slack sharing data. | |
| 61 | 62 | * @param Indexable_Presentation $presentation The presentation of an indexable. |
| 62 | 63 | */ |
| 63 | 64 | return \apply_filters( 'wpseo_enhanced_slack_data', $data, $this->presentation ); |
| 64 | 65 | } |