Commit 905f9628 authored by Srdjan Jocić's avatar Srdjan Jocić

Added more parameters to 'ninja_forms_merge_label' filter and new...

Added more parameters to 'ninja_forms_merge_label' filter and new 'ninja_forms_render_options_merge_tags' filter

#4040
parent e9786bfb
Pipeline #2826 passed with stages
in 6 minutes and 11 seconds
...@@ -50,7 +50,7 @@ final class NF_MergeTags_Fields extends NF_Abstracts_MergeTags ...@@ -50,7 +50,7 @@ final class NF_MergeTags_Fields extends NF_Abstracts_MergeTags
if( is_array( $field[ 'value' ] ) ) $field[ 'value' ] = implode( ', ', $field[ 'value' ] ); if( is_array( $field[ 'value' ] ) ) $field[ 'value' ] = implode( ', ', $field[ 'value' ] );
$return .= '<tr><td>' . apply_filters('ninja_forms_merge_label', $field[ 'label' ]) .':</td><td>' . $field[ 'value' ] . '</td></tr>'; $return .= '<tr><td>' . apply_filters('ninja_forms_merge_label', $field[ 'label' ], $field, $this->form_id) .':</td><td>' . $field[ 'value' ] . '</td></tr>';
} }
$return .= '</table>'; $return .= '</table>';
return $return; return $return;
...@@ -90,7 +90,7 @@ final class NF_MergeTags_Fields extends NF_Abstracts_MergeTags ...@@ -90,7 +90,7 @@ final class NF_MergeTags_Fields extends NF_Abstracts_MergeTags
if( is_array( $field[ 'value' ] ) ) $field[ 'value' ] = implode( ', ', $field[ 'value' ] ); if( is_array( $field[ 'value' ] ) ) $field[ 'value' ] = implode( ', ', $field[ 'value' ] );
// Check to see if the type is a list field and if it is... // Check to see if the type is a list field and if it is...
$return .= '<tr><td valign="top">' . apply_filters('ninja_forms_merge_label', $field[ 'label' ]) .':</td><td>' . $field[ 'value' ] . '</td></tr>'; $return .= '<tr><td valign="top">' . apply_filters('ninja_forms_merge_label', $field[ 'label' ], $field, $this->form_id) .':</td><td>' . $field[ 'value' ] . '</td></tr>';
} }
$return .= '</table>'; $return .= '</table>';
return $return; return $return;
...@@ -137,7 +137,7 @@ final class NF_MergeTags_Fields extends NF_Abstracts_MergeTags ...@@ -137,7 +137,7 @@ final class NF_MergeTags_Fields extends NF_Abstracts_MergeTags
if( is_array( $field[ 'value' ] ) ) $field[ 'value' ] = implode( ', ', $field[ 'value' ] ); if( is_array( $field[ 'value' ] ) ) $field[ 'value' ] = implode( ', ', $field[ 'value' ] );
$return .= '<tr><td valign="top">' . apply_filters('ninja_forms_merge_label', $field[ 'label' ]) .':</td><td>' . $field[ 'value' ] . '</td></tr>'; $return .= '<tr><td valign="top">' . apply_filters('ninja_forms_merge_label', $field[ 'label' ], $field, $this->form_id) .':</td><td>' . $field[ 'value' ] . '</td></tr>';
} }
$return .= '</table>'; $return .= '</table>';
return $return; return $return;
...@@ -248,6 +248,7 @@ final class NF_MergeTags_Fields extends NF_Abstracts_MergeTags ...@@ -248,6 +248,7 @@ final class NF_MergeTags_Fields extends NF_Abstracts_MergeTags
// Loop over our options... // Loop over our options...
$field[ 'options' ] = apply_filters( 'ninja_forms_render_options', $field[ 'options' ], $field ); $field[ 'options' ] = apply_filters( 'ninja_forms_render_options', $field[ 'options' ], $field );
$field[ 'options' ] = apply_filters( 'ninja_forms_render_options_' . $field['type'], $field[ 'options' ], $field ); $field[ 'options' ] = apply_filters( 'ninja_forms_render_options_' . $field['type'], $field[ 'options' ], $field );
$field[ 'options' ] = apply_filters( 'ninja_forms_render_options_merge_tags', $field[ 'options' ], $field, $this->form_id );
foreach( $field[ 'options' ] as $options ) { foreach( $field[ 'options' ] as $options ) {
// ...checks to see if our list has multiple values. // ...checks to see if our list has multiple values.
if( is_array( $field[ 'value' ] ) ) { if( is_array( $field[ 'value' ] ) ) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment