function ingredients($ingr){
if(!in_category(243)) {
$ingr = Preg_Replace_Callback('!<ol>(.*?)</ol>!si', Create_Function('$matches','Return Str_Replace("<li>", "<li itemprop=\"ingredients\" class= \"ingredient\">", $matches[0]);'),$ingr);
}
return $ingr;
}
a̶d̶d̶_̶f̶i̶l̶t̶e̶r̶(̶'̶t̶h̶e̶_̶c̶o̶n̶t̶e̶n̶t̶'̶,̶ ̶'̶i̶n̶g̶r̶e̶d̶i̶e̶n̶t̶s̶'̶)̶;̶
echo ingredients(get_field('название_поля'))
class ArticleCollection extends ResourceCollection
{
/**
* Transform the resource collection into an array.
*
* @param \Illuminate\Http\Request $request
* @return array|\Illuminate\Contracts\Support\Arrayable|\JsonSerializable
*/
public function toArray($request)
{
return [
'data' => [
'id' => $this->id,
................
],
];
}
}