: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
<?php namespace la\core\settings;
if ( ! defined( 'WPINC' ) ) die;
* @author Looks Awesome <email@looks-awesome.com>
* @link http://looks-awesome.com
* @copyright Looks Awesome
function __construct($stream) {
$this->stream = (array)$stream;
public function getId() {
return $this->stream['id'];
public function getCountOfPostsOnPage() {
if (isset($this->stream["page-posts"]) && $this->stream["page-posts"] != ''){
return $this->stream["page-posts"];
public function getAllFeeds() {
return $this->stream['feeds'];
//return json_decode($this->stream['feeds']);
public function original() {
public function isPossibleToShow(){
$mobile = (bool)$this->is_mobile();
$hideOnMobile = LASettingsUtils::YepNope2ClassicStyleSafe($this->stream, 'hide-on-mobile', false);
if ($hideOnMobile && $mobile) return false;
$hideOnDesktop = LASettingsUtils::YepNope2ClassicStyleSafe($this->stream, 'hide-on-desktop', false);
if ($hideOnDesktop && !$mobile) return false;
$private = LASettingsUtils::YepNope2ClassicStyleSafe($this->stream, 'private', false);
if ($private && !is_user_logged_in()) return false;
public function showOnlyMediaPosts(){
if (!isset($this->stream["show-only-media-posts"])) return false;
return LASettingsUtils::YepNope2ClassicStyle($this->stream["show-only-media-posts"], false);
public function getImageWidth() {
$value = isset($this->stream["theme"]) ? $this->stream["theme"] : 'custom';
$width = isset($this->stream["width"]) ? $this->stream["width"] : 300;
return ($value == 'classic') ? $width - 30 : $width;
public function order() {
if (isset($this->stream["order"]) && !empty($this->stream["order"])) {
return $this->stream["order"];
private function is_mobile(){
return preg_match("/(android|avantgo|blackberry|bolt|boost|cricket|docomo|fone|hiptop|mini|mobi|palm|phone|pie|tablet|up\.browser|up\.link|webos|wos)/i",
(!empty($_SERVER['HTTP_USER_AGENT']) ? $_SERVER["HTTP_USER_AGENT"] : "unknown"));