Search code examples
wordpressredux-framework

use Redux::setOption to save value in media option


I use below code to save value to Media type option in redux framework. it save in database but I can not see it in redux options. Media type has ID and URL that should be saved on database but with this code, can not do that.

Redux::setOption('sample_options','sample_favicon', 'http://URL_TO_IMAGE');

Solution

  • You need to do it like this

      $option_array   =   array('url'=>$option_value);
      Redux::setOption('sample_options','sample_favicon', $option_array);
    

    replace $option_value with your image path.