I have made fontawesome name dynamic using custom field. The code snippet is something like this:
$m_service_icon = get_post_meta( $post->ID, ‘service_icon’, true );
fa-<?php if($m_service_icon): echo $m_service_icon; else: echo ‘wordpress’; endif
And I would like to know that whether I have to validate $m_service_icon or not.
If I have to, then how can I validate that?
In this way… esc_attr($m_service_icon)
or, esc_html($m_service_icon) ?
I am eagerly looking forward to your help.
Thanks for taking the trouble to read.