set_theme_mod with array
-
Hello,
I need to manually update a theme mod (or customize value) when it is in an array.
This works:
set_theme_mod( 'myvar' , 'my value' ) ;
But how to set the value when it is in array?
non of these work, after hours of searching I cannot seem to find an answer.set_theme_mod( 'myarray["myvar"]' , 'my value' ) ; set_theme_mod( 'myarray' , array('myvar'=>'my value' ) ;
The only hint I can get is that when calling the value from an array you use.
$options = get_option('myarray'); echo $options['myvar']);
for single you would use
get_theme_mod("myvar");
- The topic ‘set_theme_mod with array’ is closed to new replies.