Hi @77anesh
Try this instead:
add_filter( 'wpo_wcpdf_billing_address', 'wpo_wcpdf_address_company_name', 10, 2 );
function wpo_wcpdf_address_company_name( $address, $document ) {
if ( !empty($document->order) ) {
$address_type = str_replace( array( 'wpo_wcpdf_', '_address'), '', current_filter() );
$full_name = $document->order->{"get_formatted_".$address_type."_full_name"}();
$address = str_replace( array( $full_name."<br>", $full_name."<br/>", $full_name ), '', $address);
}
return $address;
}
You should avoid to change the plugin source files, because if you update the plugin you will loose your changes.
Our Professional extension does what you want in a easy way with placeholders, and you avoid potential future conflicts.
-
This reply was modified 4 years, 11 months ago by
alexmigf.