v1.0.0-dev-changes

Code Changes Overview

  • Contact and group v1 endpoints removed and API v1 removed (Disciple_Tools_Contacts and Disciple_Tools_Groups).

  • Contact and Group Record and list files removed and replace with the custom post type structure.

    • All tiles are modular including details tile.

    • Page for creating posts is more flexible.

  • Channels merged into fields list.

  • List query upgraded.

  • List page upgraded.

    • Dynamic list columns.

    • Dynamic list columns order.

  • Roles and capabilities are now built by the post-types.

  • Support for deleting a post.

  • Contacts are divided into types.

  • Modules to add to a post-type.

    • Some field are only available if the module is active. Ex: the seeker_path field is only available when the access module is enabled.

Structure changes

Files removed:

  • dt-contacts/contacts.php

  • dt-contacts/contact-endpoints.php

  • dt-contacts/contacts-template.php

  • archive-contacts.php

  • template-contacts-new.php

  • single-contacts.php

  • dt-assets/parts/contact-details.php

  • dt-assets/parts/content-contacts.php

  • dt-groups/groups.php

  • dt-groups/group-endpoints.php

  • dt-groups/groups-template.php

  • archive-groups.php

  • template-groups-new.php

  • single-groups.php

  • dt-assets/parts/group-details.php

  • dt-assets/parts/content-groups.php

API changes

v1 Function removed

Search for these

  • Disciple_Tools_Contact_Post_Type::

  • Disciple_Tools_Contacts::

  • Disciple_Tools_Groups_Post_Type::

  • Disciple_Tools_Groups::

And replace as follows:

FindReplaceNote

Disciple_Tools_Contacts::get_contact(

DT_Posts::get_post( "contacts",

The order of parameters has also changed. $check_permissions is before $silent

Disciple_Tools_Contacts::create_contact(

DT_Posts::create_post( "contacts",

The order of parameters has also changed. $check_permissions is before $silent

Disciple_Tools_Contacts::update_contact(

DT_Posts::update_post( "contacts",

The order of parameters has also changed. $check_permissions is before $silent

Disciple_Tools_Contacts::add_comment(

DT_Posts::add_post_comment( "contacts",

Disciple_Tools_Contacts::search_viewable_contacts(

DT_Posts::search_viewable_post( "contacts",

Disciple_Tools_Contacts::get_contact_fields();

DT_Posts::get_post_field_settings( "contacts" );

Disciple_Tools_Contact_Post_Type::instance()->get_custom_fields_settings();

DT_Posts::get_post_field_settings( "contacts" );

Disciple_Tools_Groups::get_group(

DT_Posts::get_post( "groups",

The order of parameters has also changed. $check_permissions is before $silent

Disciple_Tools_Groups::create_group(

DT_Posts::create_post( "groups",

The order of parameters has also changed. $check_permissions is before $silent

Disciple_Tools_Groups::update_group(

DT_Posts::update_post( "groups",

The order of parameters has also changed. $check_permissions is before $silent

Disciple_Tools_Groups_Post_Type::instance()->get_custom_fields_settings();

DT_Posts::get_post_field_settings( "groups" );

Hooks Removed:

  • dt_contact_update

  • dt_contact_created

  • dt_group_created

  • dt_group_updated

  • dt_pre_contacts_connections_section

  • dt_post_contacts_progress_section

  • dt_pre_contacts_progress_section

  • dt_pre_contacts_other_section

  • dt_post_contacts_other_section

  • dt_contact_detail_notification -> dt_record_top_above_details

API Hooks documentation Record Page Hooks documentation

Consistently using post_date in the API

The post date was represented in 4 different ways:

  • create_date (in creating a post)

  • created_date (in getting a post)

  • created_on (in list query)

  • post_date (in getting a post in the list)

We've changed them all to be post_date

  • create_date => post_date

  • created_date => post_date

  • created_on -> post_date

Consistently using name for record title/name

  • List response included: post_title. Now includes name and post_title

  • Create post accepted: title and now accepts title and name

  • Get post returned: title and now returns name and title

  • Search posts was N/A -> You can now search for name

ID returned from create_contact

create_contact used to return the contact_id. create_post returns the full post. If the user has permissions to create posts but not read posts the function will return only an array with the ID of the new post:

[ "ID" => 123 ]

Field settings changes

  • Contacts

    • name: new field. Type: text

    • nickname: new field. Type: text

    • faith_status: new field (DMM module). Type: multi_select

    • post_date: repurposed. Type: date

    • type: repurposed. Type: multi_select

      • Contact type field value media is now access and a migration converts them all.

    • languages: new field. Type: multi_select

    • contact_phone: Channel migration. Type: communication_channel

    • contact_email: Channel migration. Type: communication_channel

    • contact_address: Channel migration. Type: communication_channel

    • contact_facebook: Channel migration. Type: communication_channel

    • contact_twitter: Channel migration. Type: communication_channel

    • baptism_generation: Changed from text to number. Type: number

    • last_modified: Changed from number to date. Type: date

  • Groups

List query

  • assigned_to => 'all' is now not a query

  • assigned_to => 'shared' is now "shared_with" => [ "me"]

  • The combine parameter no longer works.

  • Maximum query limit is 1000.

The list query is now more flexible with:

See List Query Documentation.

Transfer Contact API

The Endpoint used by the front end to send a contact to another instance has changed: POST dt/v1/contact/transfer -> POST dt-posts/v2/contacts/transfer

The endpoint to receive a transfer has also changed: POST dt-public/v1/contact/transfer -> POST dt-posts/v2/contact/receive-transfer

Channels

Upgrade to the function to get the channels list: Disciple_Tools_Contact_Post_Type::instance()->get_channels_list(); -> DT_Posts::get_post_settings( "contacts" )["channels"];

Channels continue to be available in the "channels" key in the post type settings array.

Channel are now also part of the field list and follow the new format in the field list. So Instead of:

"phone" => [
    'label' => "Phone
]

the field will look like

"contact_phone => [
   'name' => "Phone"
]
  • dt_custom_channels filter was removed

  • dt_custom_channels option was removed

Javascript changes

contactsDetailsWpApiSettings and wpApiGroupsSettings are no longer available. Look for window.detailsSettings or window.wpApiShare instead

Examples: window.contactsDetailsWpApiSettings.contacts_custom_fields_settings -> window.detailsSettings.post_settings.fields window.contactsDetailsWpApiSettings.contact -> window.detailsSettings.post_fields

DT_Posts Functions

Removed:

  • removed function find_contacts_by_title()

  • removed function get_viewable_post()

New Functions:

//get the list of tiles for a post_type DT_Posts::get_post_tiles( $post_type );

//get the list of fields for a post_type DT_Posts::get_post_field_settings( $post_type );

//Get all the post_type settings DT_Posts::get_post_settings( $post_type )

//get modules dt_get_option( 'dt_post_type_modules' ); See modules documentation

//Duplicate checker

Notes

Please submit a PR if you find something missing from this page.

Last updated