majaluk
Sophomore
Just Getting Started
Member Likes (0)
I have been trying to style my custom fields in custompress when i noticed that there attributes & id's that can give me some more option in this area (i think). I also would like to make a link and the ability to use some html in a custom field.
Would i be able to accomplish this or will it take extensive coding to make it happen?

Responses (5)
Support Kangaroo (joined March 2011) Likes (0)
Greetings majaluk,
Thank you for the great question.
From what I am understanding you want to allow html In the "Field Type" in the custom field section.
I believe this was intentionally excluded for security reason just like raw html in WordPress is excluded except for admins.
However, since I am in fact not the lead developer of Custom Press and that I do not know everything, I think we should get an opinion from the reigning authority Arnold on this subject.
Therefore I will see if I can get the lead developer Arnold in here with his invaluable insight into this plugin for his advice/advise for us.
Though this may take a bit longer then a normal ticket, I will try to get him in here asap.
Cheers, Joe
Developer (joined January 2012) Likes (0)
Custom fields were intended to store data so it couldbe used any place that data is needed. If you start putting you a bunch of html around it IN the field your overcomplicating that and creating security problems. You are also depending on the person doing the input getting it right. Since it was intended to be simple we don't do it.
However you can always wrap a given shortcode for a field with whatever HTML you want either in the template or in a post.. For example in a template you coulddo things like.
We've had some people use this kind of thing to create maps from a set of custom address fields.
You can also use add_filter to add wahtever you want to a given custom fields output. There are three filter
Where $result is the normal output of the shortcode,
$atts is the set of attribute passed to the shortcode,
$content is the incoming content of the meta field.
With that you can completely override how the shortcodes work and be specific down to the individual field id.
Member (joined September 2011) Likes (0)
Thank you very much for this answer. I would like to know if you could give me an example of using the add_filter. I'm not quite sure how i would apply that. Then im off to the races. Thank you again.
Developer (joined January 2012) Likes (0)
Support Chimp (joined March 2010) Likes (0)
Hey there, hope you are well!
Just checking in to see how things are going and if you need further assistance.
If you do then please feel free to reopen this thread or create a new one.
Take care and have a fantastic day!
Become a member