Hi I am new to hooks and have a query to add additional data to the existing array. Please check the below code.
I have some basic details and want to add the Phone number using add_filter(). If I give directly,it is working. But I need to do this using filter. Please help...
function give_import_donations_options()
{
return (array) apply_filters(
'give_import_donations_options',
[
'id' => __( 'Donation ID', 'give' ),
'first_name' => [
__( 'Donor First Name', 'give' ),
__( 'First Name', 'give' ),
__( 'Name', 'give' ),
__( 'First', 'give' ),
],
'last_name' => [
__( 'Donor Last Name', 'give' ),
__( 'Last Name', 'give' ),
__( 'Last', 'give' ),
],
'company_name' => [
__( 'Company Name', 'give' ),
__( 'Donor Company Name', 'give' ),
__( 'Donor Company', 'give' ),
__( 'Company', 'give' ),
],
'country' => __( 'Country', 'give' ),
'notes' => __( 'Notes', 'give' ),
/*'give_phone' => __( 'Phone', 'give' ),*/
]
);
}'
I am trying to add phone number using filter:
function additional_field
{
need to add code to add Phone Number...
}
add_filter('give_import_donations_options','additional_field...')