Home › Forums › General Issues › From input (FE) to select or textarea (BE) › Reply To: From input (FE) to select or textarea (BE)
I’m not sure I completely understand, but would something like this work?
function append_url_to_field($new_input) {
$current_values = get_field('list_of_urls', 'option')?:'';
if($current_values) {
$current_values .= ',';
}
$current_values .= $new_input;
}
You create a simple ‘text’ field on an options page/or other, and simply append it the new value to the existing value.
Whenever you want to work with the domains you can use explode(',', $field_value)
to get an array of urls.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.