Commit abc3be0c authored by Kevin Stover's avatar Kevin Stover Committed by GitHub

Merge pull request #2943 from wpninjas/issue#2939

Created conversion check for the nf_sub_seq_num short code 
parents 6390e3b2 935d321c
......@@ -359,12 +359,20 @@ final class NF_Database_Models_Form extends NF_Abstracts_Model
// Convert Shortcodes
$shortcode = "[ninja_forms_field id=$field_id]";
if( ! is_array( $value ) ) {
if (FALSE !== strpos($value, $shortcode)) {
$value = str_replace($shortcode, '{field:' . $field_key . '}', $value);
if ( FALSE !== strpos( $value, $shortcode ) ) {
$value = str_replace( $shortcode, '{field:' . $field_key . '}', $value );
}
}
}
//Checks for the nf_sub_seq_num short code and replaces it with the submission sequence merge tag
$sub_seq = '[nf_sub_seq_num]';
if( ! is_array( $value ) ) {
if( FALSE !== strpos( $value, $sub_seq ) ){
$value = str_replace( $sub_seq, '{submission:sequence}', $value );
}
}
if( ! is_array( $value ) ) {
if (FALSE !== strpos($value, '[ninja_forms_all_fields]')) {
$value = str_replace('[ninja_forms_all_fields]', '{field:all_fields}', $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