File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -336,9 +336,10 @@ public function get_attribute($key = null, $default = null)
336
336
*
337
337
* @param string|array one option value, or multiple value=>label pairs in an array
338
338
* @param string
339
+ * @param bool Whether or not to replace the current options
339
340
* @return Fieldset_Field this, to allow chaining
340
341
*/
341
- public function set_options ($ value , $ label = null )
342
+ public function set_options ($ value , $ label = null , $ replace_options = false )
342
343
{
343
344
if ( ! is_array ($ value ))
344
345
{
@@ -361,7 +362,7 @@ public function set_options($value, $label = null)
361
362
}
362
363
};
363
364
364
- empty ($ this ->options ) ? $ this ->options = $ value : $ merge ($ this ->options , $ value , $ merge );
365
+ ( $ replace_options or empty ($ this ->options ) ) ? $ this ->options = $ value : $ merge ($ this ->options , $ value , $ merge );
365
366
366
367
return $ this ;
367
368
}
You can’t perform that action at this time.
0 commit comments