Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93
/home/sportsfe.../httpdocs/wp-conte.../plugins/wordpres.../src/presente.../slack
File: enhanced-data-presenter.php
<?php
[0] Fix | Delete
[1] Fix | Delete
namespace Yoast\WP\SEO\Presenters\Slack;
[2] Fix | Delete
[3] Fix | Delete
use Yoast\WP\SEO\Presentations\Indexable_Presentation;
[4] Fix | Delete
use Yoast\WP\SEO\Presenters\Abstract_Indexable_Presenter;
[5] Fix | Delete
[6] Fix | Delete
/**
[7] Fix | Delete
* Presenter class for the Slack enhanced data.
[8] Fix | Delete
*/
[9] Fix | Delete
class Enhanced_Data_Presenter extends Abstract_Indexable_Presenter {
[10] Fix | Delete
[11] Fix | Delete
/**
[12] Fix | Delete
* The tag key name.
[13] Fix | Delete
*
[14] Fix | Delete
* @var string
[15] Fix | Delete
*/
[16] Fix | Delete
protected $key = 'twitter:misc';
[17] Fix | Delete
[18] Fix | Delete
/**
[19] Fix | Delete
* Presents the enhanced data for Slack
[20] Fix | Delete
*
[21] Fix | Delete
* @return string The Twitter tags for Slack.
[22] Fix | Delete
*/
[23] Fix | Delete
public function present() {
[24] Fix | Delete
$enhanced_data = $this->get();
[25] Fix | Delete
$twitter_tags = '';
[26] Fix | Delete
$i = 1;
[27] Fix | Delete
$class = \is_admin_bar_showing() ? ' class="yoast-seo-meta-tag"' : '';
[28] Fix | Delete
foreach ( $enhanced_data as $label => $value ) {
[29] Fix | Delete
$twitter_tags .= \sprintf( "\t" . '<meta name="twitter:label%1$d" content="%2$s"' . $class . ' />' . "\n", $i, \esc_attr( $label ) );
[30] Fix | Delete
$twitter_tags .= \sprintf( "\t" . '<meta name="twitter:data%1$d" content="%2$s"' . $class . ' />' . "\n", $i, \esc_attr( $value ) );
[31] Fix | Delete
++$i;
[32] Fix | Delete
}
[33] Fix | Delete
[34] Fix | Delete
return \trim( $twitter_tags );
[35] Fix | Delete
}
[36] Fix | Delete
[37] Fix | Delete
/**
[38] Fix | Delete
* Gets the enhanced data array.
[39] Fix | Delete
*
[40] Fix | Delete
* @return array The enhanced data array
[41] Fix | Delete
*/
[42] Fix | Delete
public function get() {
[43] Fix | Delete
$data = [];
[44] Fix | Delete
$author_id = $this->presentation->source->post_author;
[45] Fix | Delete
$estimated_reading_time = $this->presentation->estimated_reading_time_minutes;
[46] Fix | Delete
[47] Fix | Delete
if ( $this->presentation->model->object_sub_type === 'post' && $author_id ) {
[48] Fix | Delete
$data[ \__( 'Written by', 'wordpress-seo' ) ] = \get_the_author_meta( 'display_name', $author_id );
[49] Fix | Delete
}
[50] Fix | Delete
[51] Fix | Delete
if ( ! empty( $estimated_reading_time ) ) {
[52] Fix | Delete
/* translators: %s expands to the reading time number, in minutes */
[53] Fix | Delete
$data[ \__( 'Est. reading time', 'wordpress-seo' ) ] = \sprintf( \_n( '%s minute', '%s minutes', $estimated_reading_time, 'default' ), $estimated_reading_time );
[54] Fix | Delete
}
[55] Fix | Delete
[56] Fix | Delete
/**
[57] Fix | Delete
* Filter: 'wpseo_enhanced_slack_data' - Allows filtering of the enhanced data for sharing on Slack.
[58] Fix | Delete
*
[59] Fix | Delete
* @param array $data The enhanced Slack sharing data.
[60] Fix | Delete
* @param Indexable_Presentation $presentation The presentation of an indexable.
[61] Fix | Delete
*/
[62] Fix | Delete
return \apply_filters( 'wpseo_enhanced_slack_data', $data, $this->presentation );
[63] Fix | Delete
}
[64] Fix | Delete
}
[65] Fix | Delete
[66] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function