Class Disciple_Tools_Contacts
| package |
Disciple_Tools\Posts\Contacts |
|---|
__construct()
accept_contact(integer $contact_id, boolean $accepted) : array|\WP_Error
integer
boolean
array|\WP_Error
add_comment(integer $contact_id, string $comment_html, string $type = "comment", array $args = array(), boolean $check_permissions = true, boolean $silent = false) : false|integer|\WP_Error
integer
string
stringnormally 'comment', different comment types can have their own section in the comments activity
array[user_id, comment_date, comment_author etc]
boolean
boolean
false|integer|\WP_Error
add_connection_to_post(\string $post_type, \int $post_id, \string $field_key, \int $value)
\string
\int
\string
\int
add_default_custom_list_filters( $filters)
add_post_contact_method(array $post_settings, \int $post_id, \string $key, \string $value, array $field)
array
\int
\string
\string
array
add_shared_on_contact(integer $post_id, integer $user_id, array $meta = null, boolean $send_notifications = true, boolean $check_permissions = true, boolean $insert_activity = true) : false|integer|\WP_Error
integer
integer
array
boolean
boolean
boolean
false|integer|\WP_Error
adjust_post_custom_fields(array $post_settings, integer $post_id, array &$fields, array $fields_to_return = array(), null $meta_fields = null, null $post_user_meta = null) : void
arrayThis is what get_custom_fields_settings() returns
integerThe ID number of the contact
arrayThis array will be mutated with the results
arrayif not empty only add the fields that are specified (optional)
nulla way to pass in the post's meta fields instead of getting in from the database (optional)
nullpass in the user post meta if already available (optional)
can_access(string $post_type) : boolean
string
boolean
can_create(string $post_type) : boolean
string
boolean
can_delete(string $post_type) : boolean
string
boolean
can_update(string $post_type, integer $post_id) : boolean
string
integer
boolean
can_view(string $post_type, integer $post_id) : boolean
string
integer
boolean
can_view_all(string $post_type) : boolean
string
boolean
check_for_duplicates( $contact_id, $fields)
check_for_invalid_post_fields(array $post_settings, array $fields, array $allowed_fields = array()) : array
array
array
array
array
check_requires_update( $contact_id)
check_seeker_path( $contact_id, $initial_fields, $contact, $previous_values)
close_duplicate_contact(\int $duplicate_id, \int $contact_id)
\int
\int
copy_comments(\int $master_id, \int $non_master_id, $check_permissions = true)
\int
\int
create_contact(array $fields = array(), boolean|true $check_permissions = true, boolean|true $silent = false) : integer
| since | 0.1.0 |
|---|
array, the new contact's data
boolean|true
boolean|true
integer| WP_Error
create_post_field_hook( $fields, $post_type)
delete_comment(\int $contact_id, \int $comment_id, \bool $check_permissions = true)
\int
\int
\bool
delete_post(\int $post_id, \string $post_type)
\int
\string
dismiss_all(\int $contact_id)
\int
dismiss_duplicate(\int $contact_id, \int $dismiss_id)
\int
\int
dt_comment_created( $post_type, $post_id, $comment_id, $type)
dt_get_post_fields_filter( $fields, $post_type)
dt_user_list_filters( $filters, $post_type)
escape_regex_mysql(\string $regex)
\string
filter_wp_post_object_fields(object $post) : array
object
array
find_contacts_by_title( $title, $exclude_id)
find_contacts_with( $field, $value, $exclude_id = "", $exact_match = false)
format_post_contact_details( $post_settings, $meta_fields, $type, $key, $value)
get_activity( $contact_id) : array|null|object
array|null|object
get_all_contacts_status_seeker_path()
get_all_duplicates()
get_channel_list() : mixed
mixed
get_comments(integer $contact_id, boolean $check_permissions = true, string $type = "all") : array|integer|\WP_Error
integer
boolean
string
array|integer|\WP_Error
get_contact(integer $contact_id, boolean $check_permissions = true, boolean $load_cache = false) : array
| access |
public |
|---|---|
| since | 0.1.0 |
integer, the contact post_id
boolean
boolean
arrayWP_Error, On success: the contact, else: the error message
get_contact_fields() : mixed
mixed
get_count_of_contacts(string $tab = "my", boolean $show_closed = false) : array|\WP_Error
Example Array Return: [ [my_contacts] => 39 [update_needed] => 0 [contact_attempted] => 1 [meeting_scheduled] => 0 [shared] => 5 [all_contacts] => 43 [needs_assigned] => 0 ]
This function will always return this array even if the counts are zero.
If the current user/supplied user is not a dispatcher role or similar, then it will skip the query and return zeros for all_contacts and needs assigned array elements.
string
boolean
array|\WP_Error
get_duplicate_data( $contact_id, $field)
get_duplicates_on_contact( $contact_id)
get_field_details( $field, $contact_id)
get_label_for_post_type( $post_type, $singular = false)
get_merge_data(\int $contact_id, \int $duplicate_id)
\int
\int
get_most_recent_activity_for_field( $post_id, $field_key) : mixed
mixed
get_my_contacts_status_seeker_path()
get_post_by_title_cached(string $title, string $output = OBJECT, string|array $post_type = 'page', $connection_type = 'none') : \WP_Post|null
| link |
Uncached Functions |
|---|
stringPage title
stringOptional. Output type; OBJECT*, ARRAY_N, or ARRAY_A.
string|arrayOptional. Post type; default is 'page'.
\WP_Post|nullWP_Post on success or null on failure
get_posts_shared_with_user(string $post_type, integer $user_id, $search_for_post_name = '') : array
string
integer
array
get_settings() : array|\WP_Error
array|\WP_Error
get_shared_with_on_contact(integer $post_id) : array|mixed
integer
array|mixed
get_single_activity( $contact_id, $activity_id) : array|null|object
array|null|object
get_subassigned_users( $post_id)
get_user_contacts(integer $user_id, boolean $check_permissions = true, array $query_pagination_args = array()) : \WP_Query
| access |
public |
|---|---|
| since | 0.1.0 |
integer
boolean
array-Pass in pagination and ordering parameters if wanted.
\WP_Query| WP_Error
get_user_posts()
get_viewable(string $post_type, integer $most_recent) : array|\WP_Error|\WP_Query
string
integer
array|\WP_Error|\WP_Query
get_viewable_contacts(integer $most_recent, boolean $check_permissions = true) : array
| access |
public |
|---|---|
| since | 0.1.0 |
integerdate of most recent update
boolean
array| WP_Error | WP_Query
get_viewable_contacts_compact(string $search_string) : array|\WP_Query
string
array|\WP_Query
increment( &$var, $val)
is_post_key_contact_method_or_connection( $post_settings, $key)
merge_p2p(\int $master_id, \int $non_master_id)
\int
\int
post_connection_added( $post_type, $post_id, $post_key, $value)
post_connection_removed( $post_type, $post_id, $post_key, $value)
post_created_hook( $post_type, $post_id, $initial_fields)
post_updated_hook( $post_type, $post_id, $updated_fields, $previous_values)
query_with_pagination(array $query_args, array $query_pagination_args) : \WP_Query
These two statements are equivalent in this example: $query = self::query_with_pagination( [ "post_type" => "contacts" ], [ "orderby" => "ID" ] ); // equivalent to: $query = new WP_Query( [ "post_type" => "contacts", "orderby" => "ID" ] ); The second argument, $query_pagination_args, may only contain keys related to ordering and pagination, if it doesn't, this method will return a WP_Error instance. This is useful in case you want to allow a caller to modify pagination and ordering, but not anything else, in order to keep permission checking valid. If $query_pagination_args is specified with at least one value, then all pagination-related keys in the first argument are ignored.
array
array
\WP_Query| WP_Error
recheck_duplicates(\int $contact_id)
\int
remove_connection_from_post(\string $post_type, \int $post_id, \string $field_key, \int $value)
\string
\int
\string
\int
remove_fields( $contact_id, $fields = array(), $ignore = array())
remove_shared_on_contact(integer $post_id, integer $user_id) : false|integer|\WP_Error
integer
integer
false|integer|\WP_Error
revert_activity( $contact_id, $activity_id) : boolean|integer|\WP_Error
boolean|integer|\WP_Error
save_duplicate_data(\int $contact_id, array $duplicates)
\int
array
save_duplicate_finding( $field, $dups, $contact_id)
search_viewable_contacts(array $query, \bool $check_permissions = true)
array
\bool
search_viewable_post(\string $post_type, array $query, \bool $check_permissions = true)
\string
array
\bool
unique_hash()
unsure_all(\int $contact_id)
\int
unsure_duplicate(\int $contact_id, \int $unsure_id)
\int
\int
update_comment(\int $contact_id, \int $comment_id, \string $comment_content, \bool $check_permissions = true)
\int
\int
\string
\bool
update_connections(array $post_settings, \int $post_id, array $fields, $existing_contact = null)
array
\int
array
update_contact(integer|null $contact_id, array $fields, boolean|null $check_permissions = true, boolean $silent = false) : array
| access |
public |
|---|---|
| since | 0.1.0 |
integer|null, the post id for the contact
array, the meta fields
boolean|null
boolean
array| WP_Error the contact
update_location_grid_fields(array $field_settings, \int $post_id, array $fields, $post_type, array $existing_post = null)
array
\int
array
array
update_multi_select_fields(array $field_settings, \int $post_id, array $fields, array $existing_contact = null)
array
\int
array
array
update_post_contact_method(\int $post_id, \string $key, array $values)
\int
\string
array
update_post_contact_methods(array $post_settings, \int $post_id, array $fields, array $existing_contact = null)
array
\int
array
array
update_post_field_hook( $fields, $post_type, $post_id)
update_seeker_path(integer $contact_id, string $path_option, boolean $check_permissions = true) : array|integer|\WP_Error
integer
string
boolean
array|integer|\WP_Error
add_comm_channel_comment_section
Arguments
$sections
$post_type