Skip to content

wirePopulateStringTags() does not work with subfields #940

Open
@noelboss

Description

@noelboss

I can't seem to make subfields in wirePopulateStringTags() work.

Optional: Steps that explain the enhancement

Tried everything, nothing worked. For example, consider the following:

dump(
	wirePopulateStringTags(
		'{page.title}', 
		new WireData([
			'page' => wire('pages')->get(1)
		]), 
		[
			'recursive' => true,
			'removeNullTags' => false
		]
	)
);

dump(
	wirePopulateStringTags(
		'{page.title}',
		[
			'page' => wire('pages')->get(1),
		],
		[
			'recursive'      => true,
			'removeNullTags' => false,
		]
	)
);

Output:

Screenshot 2019-07-25 at 13 39 35

The explanations from the doc page are not conclusive or helpful beyond the simple user:
https://processwire.com/api/ref/functions/wire-populate-string-tags/

Is it me? Or it might just simply not work (looking at the source) – but it would be amazing if it did – would save us from some simple plugins…

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions