So I am trying to replace the original post_title with a custom field right of the same post after saving the changes. However, I am getting the following error on the post page:
Warning: Missing argument 2 for wpse33385_filter_title() in $PATH/public_html/wp-content/themes/$THEME/functions.php on line 113
// replaces the original post_title with the value of pac-short-title
add_filter( 'the_title', 'wpse33385_filter_title', 10, 2);
function wpse33385_filter_title( $title, $post_id )
{
if( $new_title = types_get_field_meta_value( 'pac-short-title', $post_id ) )
{
return $new_title;
}
return $title;
}
I am confused because I have defined a number of arguments in the add_filter?
apply_filters()call? - Tristan