[advancedcontentfilter] Add new attachments key in filter #1157

Merged
MrPetovan merged 2 commits from task/advancecontentfilter-attachments into develop 2021-08-17 12:41:17 +02:00
Showing only changes of commit b141416b51 - Show all commits

View file

@ -282,6 +282,7 @@ function advancedcontentfilter_build_fields($data)
'event_created', 'event_edited', 'event_start', 'event_finish', 'event_summary',
'event_desc', 'event_location', 'event_type', 'event_nofinish', 'event_adjust', 'event_ignore',
'children', 'pagedrop', 'tags', 'hashtags', 'mentions',
'attachments',
];
$expressionLanguage = new ExpressionLanguage\ExpressionLanguage();
@ -437,6 +438,10 @@ function advancedcontentfilter_get_variables_guid(ServerRequestInterface $reques
$item['hashtags'] = $tags['hashtags'];
$item['mentions'] = $tags['mentions'];
$attachments = Post\Media::splitAttachments($item['uri-id'], $item['guid'] ?? '');
$item['attachments'] = $attachments;
$return = advancedcontentfilter_get_filter_fields($item);
return json_encode(['variables' => str_replace('\\\'', '\'', var_export($return, true))]);