/home/techb158/balacoffee.com/wp-content/plugins/polylang/src/Options/Primitive
Edit: /home/techb158/balacoffee.com/wp-content/plugins/polylang/src/Options/Primitive/Abstract_List.php (2650B)
'array',
'items' => array(
'type' => $this->get_type(),
),
);
}
/**
* Removes an item from the list.
*
* @since 3.8
*
* @param mixed $item The item to remove.
* @return bool True if the value has been removed. False otherwise.
*/
public function remove( $item ): bool {
if ( ! in_array( $item, $this->value, true ) ) {
return false;
}
$this->value = array_diff(
$this->value,
array( $item )
);
return true;
}
/**
* Adds an item to the list.
*
* @since 3.8
*
* @param mixed $item The item to add.
* @param Options $options The options instance.
* @return bool True if the value was added successfully. False otherwise.
*/
public function add( $item, Options $options ): bool {
/** @var array $updated_value */
$updated_value = $this->get();
$updated_value[] = $item;
return $this->set(
$updated_value,
$options
);
}
}