I've added some php code to my functions.php child theme, but getting the following error message:
Parse error: syntax error, unexpected ' ' (T_STRING) in functions.php
I've been staring at the code for too long now and can't see what I'm doing wrong:
add_filter( 'pt_cv_fields_html', 'cvp_theme_other_fields_in_title', 100, 2 );
function cvp_theme_other_fields_in_title( $args, $post ) {
global $pt_cv_id;
if ( in_array( $pt_cv_id, array( 'e3cd1844un', '60d308bw40' ) ) ) {
if ( isset( $args[ 'custom-fields' ] ) ) {
$args[ 'title' ] = preg_replace( '/(<\/a>)/', ' ' . strip_tags( $args[ 'custom-fields' ] ) . '$1', $args[ 'title' ] );
unset( $args[ 'custom-fields' ] );
}
}
return $args;
}