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/smart-sl.../Nextend/Framewor.../Content/WordPres...
File: WordPressContent.php
<?php
[0] Fix | Delete
[1] Fix | Delete
namespace Nextend\Framework\Content\WordPress;
[2] Fix | Delete
[3] Fix | Delete
use Nextend\Framework\Content\AbstractPlatformContent;
[4] Fix | Delete
use WP_Query;
[5] Fix | Delete
use function get_post_thumbnail_id;
[6] Fix | Delete
use function get_post_type;
[7] Fix | Delete
use function get_post_type_object;
[8] Fix | Delete
use function get_the_excerpt;
[9] Fix | Delete
use function get_the_ID;
[10] Fix | Delete
use function get_the_permalink;
[11] Fix | Delete
use function get_the_title;
[12] Fix | Delete
use function wp_get_attachment_url;
[13] Fix | Delete
[14] Fix | Delete
class WordPressContent extends AbstractPlatformContent {
[15] Fix | Delete
[16] Fix | Delete
public function searchLink($keyword) {
[17] Fix | Delete
[18] Fix | Delete
$the_query = new WP_Query('post_type=any&posts_per_page=20&post_status=publish&s=' . $keyword);
[19] Fix | Delete
[20] Fix | Delete
$links = array();
[21] Fix | Delete
if ($the_query->have_posts()) {
[22] Fix | Delete
while ($the_query->have_posts()) {
[23] Fix | Delete
$the_query->the_post();
[24] Fix | Delete
[25] Fix | Delete
$link = array(
[26] Fix | Delete
'title' => get_the_title(),
[27] Fix | Delete
'link' => get_the_permalink(),
[28] Fix | Delete
'info' => get_post_type_object(get_post_type())->labels->singular_name
[29] Fix | Delete
);
[30] Fix | Delete
[31] Fix | Delete
$links[] = $link;
[32] Fix | Delete
[33] Fix | Delete
}
[34] Fix | Delete
}
[35] Fix | Delete
/* Restore original Post Data */
[36] Fix | Delete
wp_reset_postdata();
[37] Fix | Delete
[38] Fix | Delete
return $links;
[39] Fix | Delete
}
[40] Fix | Delete
[41] Fix | Delete
public function searchContent($keyword) {
[42] Fix | Delete
[43] Fix | Delete
$the_query = new WP_Query('post_type=any&posts_per_page=20&post_status=publish&s=' . $keyword);
[44] Fix | Delete
[45] Fix | Delete
$links = array();
[46] Fix | Delete
if ($the_query->have_posts()) {
[47] Fix | Delete
while ($the_query->have_posts()) {
[48] Fix | Delete
$the_query->the_post();
[49] Fix | Delete
[50] Fix | Delete
$link = array(
[51] Fix | Delete
'title' => get_the_title(),
[52] Fix | Delete
'description' => get_the_excerpt(),
[53] Fix | Delete
'image' => wp_get_attachment_url(get_post_thumbnail_id(get_the_ID())),
[54] Fix | Delete
'link' => get_the_permalink(),
[55] Fix | Delete
'info' => get_post_type_object(get_post_type())->labels->singular_name
[56] Fix | Delete
);
[57] Fix | Delete
[58] Fix | Delete
$links[] = $link;
[59] Fix | Delete
[60] Fix | Delete
}
[61] Fix | Delete
}
[62] Fix | Delete
/* Restore original Post Data */
[63] Fix | Delete
wp_reset_postdata();
[64] Fix | Delete
[65] Fix | Delete
return $links;
[66] Fix | Delete
}
[67] Fix | Delete
}
[68] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function