Home › Forums › General Issues › ACF with plugin YouTube LYTE › Reply To: ACF with plugin YouTube LYTE
Hi @venenum
Based on the plugin author’s answers, it should be working. You can use a text custom field to input the link and then try this code in your functions.php:
For ACF v5.
function my_acf_format_value_v5( $value, $post_id, $field ) {
$value = lyte_parse($value);
return $value;
}
add_filter('acf/format_value/name=field_name', 'my_acf_format_value_v5', 10, 3);
For ACF v4 (free version).
function my_acf_format_value_v4( $value, $post_id, $field ) {
if($field['name'] == 'field_name'){
$value = lyte_parse($value);
}
return $value;
}
add_filter('acf/format_value_for_api', 'my_acf_format_value_v4', 10, 3);
Please change the “field_name” with your custom field name.
I hope this helps!
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.