nightcoder
Forum Replies Created
Viewing 3 replies - 1 through 3 (of 3 total)
-
Forum: Plugins
In reply to: [Polylang] Warning: md5() expects parameter 1 to be string@chouby I’m not sure if WPML officially supports that but the moment you don’t have sub-keys in the XML, it register all the theme_mods available for the theme.
Forum: Plugins
In reply to: [Polylang] Warning: md5() expects parameter 1 to be string@chouby Also, please remember that WPML now allows only single key name to register all theme mods. It means no need to add theme mods one by one.
<admin-texts> <key name="theme_mods_themename"> </key> </admin-texts>In your code, you should also check if there is no sub key, if the it is a “theme_mods_***” then add all theme mods available.
Something like this;
protected function translate_strings_recursive( $values, $key ) { $children = $key->children(); if ( count( $children ) ) { foreach ( $children as $child ) { $attributes = $child->attributes(); $name = (string) $attributes['name']; if ( isset( $values[ $name ] ) ) { $values[ $name ] = $this->translate_strings_recursive( $values[ $name ], $child ); } } } else { //$values = pll__( $values ); if(is_array($values)){ $mods = get_theme_mods("themename"); foreach{ //regiter } } } return $values; }Forum: Plugins
In reply to: [Polylang] Warning: md5() expects parameter 1 to be string@chouby it may not a theme / plugin issue. @devsit probably switched from WPML plugin. I got the same error and it turned out that it is the theme_mods array of the customizer that (probably) stored by WPML. FYI.
- This reply was modified 9 years, 7 months ago by nightcoder.
Viewing 3 replies - 1 through 3 (of 3 total)