Title: loop   hyperlink = empty input after save
Last modified: August 21, 2016

---

# loop hyperlink = empty input after save

 *  Resolved [dashart](https://wordpress.org/support/users/dashart/)
 * (@dashart)
 * [12 years, 9 months ago](https://wordpress.org/support/topic/loop-hyperlink-empty-input-after-save/)
 * Hi,
    thanks for this great plugin.
 * (But) I have discovered a bug:
    1) I create a loop 2) I create inside this loop
   a field with type “hyperlink” 3) I update the settings
 * 4) I open / create a post
    5) I add a row 6) I add a hyperlink to this row with
   URL and Link Text 7) I save the post
 * What happens:
    If I open the post again, the hyperlink exists still in the loop.
   But URL and Link Text are empty.
 * What should happen:
    URL and Link Text should not be empty
 * Additional note:
    If I switch the field type, the field value is: `a:2:{i:0;a:
   1:{s:3:"url";s:16:"http://ww.web.de";}i:1;a:1:{s:4:"text";s:10:"test title";}}`
 * A fix for this would be great 😉
 * [http://wordpress.org/plugins/custom-field-suite/](http://wordpress.org/plugins/custom-field-suite/)

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Thread Starter [dashart](https://wordpress.org/support/users/dashart/)
 * (@dashart)
 * [12 years, 9 months ago](https://wordpress.org/support/topic/loop-hyperlink-empty-input-after-save/#post-4083567)
 * Okay “dirty” workaround for the backend:
    In hyperlink.php (from Plugin “CFS –
   Hyperlink Add-on”) added at line 24:
 *     ```
       // if field is used in a row ... we got each param with an array around
       // so $field->value[0]['url'] and $field->value[1]['text']
       if( empty($field->value['url']) && empty($field->value['text'])
               && !empty($field->value[0]['url']) && !empty($field->value[1]['text']) ) {
            $field->value[0]['text'] = $field->value[1]['text'];
           $field->value = $field->value[0];
       }
       ```
   
 * But frontend not working:
 *     ```
       $links = $cfs->get("external_links");
       var_dump($links);
       ```
   
 * returns only:
    `array(2) { [1]=> array(1) { ["external_link"]=> string(0) "" }[
   2]=> array(1) { ["external_link"]=> string(0) "" } } array(1) { ["external_link"]
   => string(0) "" } array(1) { ["external_link"]=> string(0) "" }`
 *  Plugin Author [Matt Gibbs](https://wordpress.org/support/users/mgibbs189/)
 * (@mgibbs189)
 * [12 years, 9 months ago](https://wordpress.org/support/topic/loop-hyperlink-empty-input-after-save/#post-4083749)
 * Thanks, I’ll check to see if it’s compatible with Loop fields.
 *  Plugin Author [Matt Gibbs](https://wordpress.org/support/users/mgibbs189/)
 * (@mgibbs189)
 * [12 years, 8 months ago](https://wordpress.org/support/topic/loop-hyperlink-empty-input-after-save/#post-4083769)
 * Closing; this is on the Github roadmap and also posted on the plugin support 
   forums: [https://uproot.us/forums/questions/1656/loop-hyperlink-empty-input-after-save](https://uproot.us/forums/questions/1656/loop-hyperlink-empty-input-after-save)

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘loop hyperlink = empty input after save’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/custom-field-suite.svg)
 * [Custom Field Suite](https://wordpress.org/plugins/custom-field-suite/)
 * [Support Threads](https://wordpress.org/support/plugin/custom-field-suite/)
 * [Active Topics](https://wordpress.org/support/plugin/custom-field-suite/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/custom-field-suite/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/custom-field-suite/reviews/)

## Tags

 * [Empty Fields](https://wordpress.org/support/topic-tag/empty-fields/)
 * [hyperlink](https://wordpress.org/support/topic-tag/hyperlink/)
 * [loop](https://wordpress.org/support/topic-tag/loop/)

 * 3 replies
 * 2 participants
 * Last reply from: [Matt Gibbs](https://wordpress.org/support/users/mgibbs189/)
 * Last activity: [12 years, 8 months ago](https://wordpress.org/support/topic/loop-hyperlink-empty-input-after-save/#post-4083769)
 * Status: resolved