$value ) { $current_parents = array_merge( $parents, array( $key ) ); /** * Don't parse element if it's exclude */ if ( wplng_json_element_is_excluded( $value, $current_parents ) ) { continue; } /** * Check the value */ if ( is_array( $value ) ) { /** * If element is an array, parse it */ $texts = array_merge( $texts, wplng_parse_json_array( $value, $current_parents ) ); } elseif ( is_string( $value ) ) { /** * If element is a string */ // Ignore if is an URL or a local ID (fr_FR, fr, FR, ...) if ( wplng_str_is_url( $value ) || wplng_str_is_locale_id( $value ) ) { continue; } if ( wplng_str_is_html( $value ) ) { /** * If element is a HTML, parse it */ $texts = array_merge( $texts, wplng_parse_html( $value ) ); } elseif ( wplng_str_is_json( $value ) ) { /** * If element is a JSON, parse it */ $texts = array_merge( $texts, wplng_parse_json( $value, $current_parents ) ); } elseif ( wplng_str_is_script_i18n( $value ) ) { /** * If element is a i18n JSON, parse it */ // Voluntarily don't pass $current_parents $texts = array_merge( $texts, wplng_parse_js_json_in_i18n_script( $value ) ); } else { /** * Element is a unknow string, check if it's translatable */ if ( ! wplng_text_is_translatable( $value ) || ! wplng_json_element_is_included( $value, $current_parents ) ) { continue; } $texts[] = $value; } } } return $texts; }