Support

Account

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!