Adding Fields and Tiles.
Adding a field to track
add_filter( "dt_custom_fields_settings", "dt_contact_fields", 1, 2 );
function dt_contact_fields( array $fields, string $post_type = ""){
//check if we are dealing with a contact
if ($post_type === "contacts"){
//check if the language field is already set
if ( !isset( $fields["language"] )){
//define the language field
$fields["language"] = [
"name" => __( "Spoken Language", "disciple_tools_language" ),
"type" => "key_select",
"default" => [
"english" => __( "English", "disciple_tools_language" ),
"french" => __( "French", "disciple_tools_language" )
],
"tile" => "contact_language"
];
}
}
//don't forget to return the update fields array
return $fields;
}Adding a Tile
Add custom content
End result

Last updated