4 thoughts on “Seperate Lines out of a Multi-Line Custom Field Value”

  1. I come across your site today and it’s one of the best.

    I too read that article on graphicbeacon for a while ago but hesitate to implement it on my project for some reason ( I am not confident that nl2br will always work. )

    as for the use case like your example ( mp3 links ) it still has limitation on the number of song to 1 per post.

    Do you know anyway to keep it working like this in one post meta entry that also works with multiple number of songs entered separated with blank line maybe ?

    url to media
    size of file
    type of file
    encoding info

    url to media
    size of file
    type of file
    encoding info

    url to media
    size of file
    type of file
    encoding info

    Suppose if we have 3 sets ( or more ) of songs like this above, is there a way to make it possible to work ?

    1. Using the line break is a bit flaky. It will always work, if it is used. But it’s so easy to forget to put it in there. For what you are looking for, the above should still work….. As long as all your input info matches the same pattern. IT can be looped over and over. There’s probably a more elegant way to handle it though. I’ll be honest, I only came up with this solution out of necessity to deal with a crashed plugin, and 2 years worth of data. I’ll try to take a look at it for a better idea, but I have a bout a million things going on right now…..

    1. Yup, I needed it for the powerpress plugin…. also a podcasting plugin. I think I’ll be revisiting this soon… I’m making a new theme, and really like the options for control this gives on using the data.

Leave a Reply