Skip to content

Commit faf96ac

Browse files
authored
gppa-populate-all-results.php: Updated to call process_template() so each object value is passed through all template filters. (#615)
1 parent 97b1ba1 commit faf96ac

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

gp-populate-anything/gppa-populate-all-results.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,13 @@
1010
* CSS Class Name setting.
1111
*/
1212
add_filter( 'gppa_process_template_value', function( $template_value, $field, $template_name, $populate, $object, $object_type, $objects, $template ) {
13-
if ( strpos( $field->cssClass, 'gppa-populate-all' ) !== false ) {
14-
$values = array();
13+
if ( ! empty( $objects ) && strpos( $field->cssClass, 'gppa-populate-all' ) !== false ) {
14+
$values = array( $template_value );
1515
foreach ( $objects as $_object ) {
16-
$values[] = $object_type->get_object_prop_value( $_object, $template );
16+
if ( $_object === $object ) {
17+
continue;
18+
}
19+
$values[] = gp_populate_anything()->process_template( $field, $template_name, $_object, $populate, array() );
1720
}
1821
$template_value = implode( ', ', $values );
1922
}

0 commit comments

Comments
 (0)